mirror of
https://github.com/browser-use/web-ui.git
synced 2026-03-22 11:17:17 +08:00
Add support for ModelScope
This commit is contained in:
@@ -59,5 +59,25 @@ model_names = {
|
||||
"Pro/THUDM/glm-4-9b-chat",
|
||||
],
|
||||
"ibm": ["ibm/granite-vision-3.1-2b-preview", "meta-llama/llama-4-maverick-17b-128e-instruct-fp8",
|
||||
"meta-llama/llama-3-2-90b-vision-instruct"]
|
||||
"meta-llama/llama-3-2-90b-vision-instruct"],
|
||||
"modelscope":[
|
||||
"Qwen/Qwen2.5-Coder-32B-Instruct",
|
||||
"Qwen/Qwen2.5-Coder-14B-Instruct",
|
||||
"Qwen/Qwen2.5-Coder-7B-Instruct",
|
||||
"Qwen/Qwen2.5-72B-Instruct",
|
||||
"Qwen/Qwen2.5-32B-Instruct",
|
||||
"Qwen/Qwen2.5-14B-Instruct",
|
||||
"Qwen/Qwen2.5-7B-Instruct",
|
||||
"Qwen/QwQ-32B-Preview",
|
||||
"Qwen/Qwen2.5-VL-3B-Instruct",
|
||||
"Qwen/Qwen2.5-VL-7B-Instruct",
|
||||
"Qwen/Qwen2.5-VL-32B-Instruct",
|
||||
"Qwen/Qwen2.5-VL-72B-Instruct",
|
||||
"deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
|
||||
"deepseek-ai/DeepSeek-R1-Distill-Qwen-14B",
|
||||
"deepseek-ai/DeepSeek-R1-Distill-Qwen-7B",
|
||||
"deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B",
|
||||
"deepseek-ai/DeepSeek-R1",
|
||||
"deepseek-ai/DeepSeek-V3",
|
||||
],
|
||||
}
|
||||
|
||||
@@ -323,5 +323,20 @@ def get_llm_model(provider: str, **kwargs):
|
||||
model_name=kwargs.get("model_name", "Qwen/QwQ-32B"),
|
||||
temperature=kwargs.get("temperature", 0.0),
|
||||
)
|
||||
elif provider == "modelscope":
|
||||
if not kwargs.get("api_key", ""):
|
||||
api_key = os.getenv("MODELSCOPE_API_KEY", "")
|
||||
else:
|
||||
api_key = kwargs.get("api_key")
|
||||
if not kwargs.get("base_url", ""):
|
||||
base_url = os.getenv("MODELSCOPE_ENDPOINT", "")
|
||||
else:
|
||||
base_url = kwargs.get("base_url")
|
||||
return ChatOpenAI(
|
||||
api_key=api_key,
|
||||
base_url=base_url,
|
||||
model_name=kwargs.get("model_name", "Qwen/QwQ-32B"),
|
||||
temperature=kwargs.get("temperature", 0.0),
|
||||
)
|
||||
else:
|
||||
raise ValueError(f"Unsupported provider: {provider}")
|
||||
|
||||
Reference in New Issue
Block a user