AIRider commited on
Commit
d345b65
1 Parent(s): f9c7426

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -11
app.py CHANGED
@@ -10,19 +10,12 @@ MODELS = {
10
  "Cohere Command R+": "CohereForAI/c4ai-command-r-plus",
11
  }
12
 
13
- MODELS_REQUIRING_TOKEN = [
14
- "meta-llama/Meta-Llama-3.1-8B-Instruct",
15
- "CohereForAI/c4ai-command-r-plus"
16
- ]
17
-
18
  def get_client(model_name):
19
  model_id = MODELS[model_name]
20
- if model_id in MODELS_REQUIRING_TOKEN:
21
- hf_token = os.getenv("HF_TOKEN")
22
- if not hf_token:
23
- raise ValueError(f"HF_TOKEN environment variable is required for {model_name}")
24
- return InferenceClient(model_id, token=hf_token)
25
- return InferenceClient(model_id)
26
 
27
  def respond(
28
  message,
 
10
  "Cohere Command R+": "CohereForAI/c4ai-command-r-plus",
11
  }
12
 
 
 
 
 
 
13
  def get_client(model_name):
14
  model_id = MODELS[model_name]
15
+ hf_token = os.getenv("HF_TOKEN")
16
+ if not hf_token:
17
+ raise ValueError("HF_TOKEN environment variable is required")
18
+ return InferenceClient(model_id, token=hf_token)
 
 
19
 
20
  def respond(
21
  message,