Spaces:
Running
Running
add qwen 30b model
Browse files
app.py
CHANGED
|
@@ -390,6 +390,11 @@ AVAILABLE_MODELS = [
|
|
| 390 |
"name": "Qwen3-235B-A22B-Thinking",
|
| 391 |
"id": "Qwen/Qwen3-235B-A22B-Thinking-2507",
|
| 392 |
"description": "Qwen3-235B-A22B-Thinking model with advanced reasoning capabilities"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 393 |
}
|
| 394 |
]
|
| 395 |
|
|
@@ -463,7 +468,13 @@ if not HF_TOKEN:
|
|
| 463 |
|
| 464 |
def get_inference_client(model_id, provider="auto"):
|
| 465 |
"""Return an InferenceClient with provider based on model_id and user selection."""
|
| 466 |
-
if model_id == "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 467 |
provider = "groq"
|
| 468 |
elif model_id == "Qwen/Qwen3-235B-A22B":
|
| 469 |
provider = "cerebras"
|
|
|
|
| 390 |
"name": "Qwen3-235B-A22B-Thinking",
|
| 391 |
"id": "Qwen/Qwen3-235B-A22B-Thinking-2507",
|
| 392 |
"description": "Qwen3-235B-A22B-Thinking model with advanced reasoning capabilities"
|
| 393 |
+
},
|
| 394 |
+
{
|
| 395 |
+
"name": "Qwen3-30B-A3B-Instruct-2507",
|
| 396 |
+
"id": "qwen3-30b-a3b-instruct-2507",
|
| 397 |
+
"description": "Qwen3-30B-A3B-Instruct model via Alibaba Cloud DashScope API"
|
| 398 |
}
|
| 399 |
]
|
| 400 |
|
|
|
|
| 468 |
|
| 469 |
def get_inference_client(model_id, provider="auto"):
|
| 470 |
"""Return an InferenceClient with provider based on model_id and user selection."""
|
| 471 |
+
if model_id == "qwen3-30b-a3b-instruct-2507":
|
| 472 |
+
# Use DashScope OpenAI client
|
| 473 |
+
return OpenAI(
|
| 474 |
+
api_key=os.getenv("DASHSCOPE_API_KEY"),
|
| 475 |
+
base_url="https://dashscope.aliyuncs.com/compatible-mode/v1",
|
| 476 |
+
)
|
| 477 |
+
elif model_id == "moonshotai/Kimi-K2-Instruct":
|
| 478 |
provider = "groq"
|
| 479 |
elif model_id == "Qwen/Qwen3-235B-A22B":
|
| 480 |
provider = "cerebras"
|