Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
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,
|