Spaces:
Paused
Paused
| import os | |
| import glob | |
| # The valid template for our models | |
| template = """name: {name} | |
| label: {label} | |
| status: active | |
| input_types: | |
| - text/plain | |
| output_types: | |
| - text/plain | |
| context_size: {context_size} | |
| output_size: 4096 | |
| """ | |
| # define context sizes we researched | |
| model_info = { | |
| "llama3-70b.yaml": ("llama3-70b", "Llama 3 70B", 8192), | |
| "claude-3-haiku.yaml": ("anthropic/claude-3-haiku", "Claude 3 Haiku", 200000), | |
| "meta-llama3-70b-instruct.yaml": ("meta/llama3-70b-instruct", "Llama 3 70B Instruct", 8192), | |
| "minimaxai-minimax-m3.yaml": ("minimaxai/minimax-m3", "Minimax M3", 1000000), | |
| "deepseek-ai-deepseek-v4-flash.yaml": ("deepseek-ai/deepseek-v4-flash", "DeepSeek v4 Flash", 1000000), | |
| "deepseek-ai-deepseek-v4-pro.yaml": ("deepseek-ai/deepseek-v4-pro", "DeepSeek v4 Pro", 1000000), | |
| "minimaxai-minimax-m2.7.yaml": ("minimaxai/minimax-m2.7", "Minimax M2.7", 204800), | |
| "nvidia-nemotron-3-ultra-550b-a55b.yaml": ("nvidia/nemotron-3-ultra-550b-a55b", "Nemotron-3 Ultra 550B", 1000000), | |
| "stepfun-ai-step-3.7-flash.yaml": ("stepfun-ai/step-3.7-flash", "Step-3.7 Flash", 256000), | |
| "qwen-qwen3.5-397b-a17b.yaml": ("qwen/qwen3.5-397b-a17b", "Qwen 3.5 397B", 262144), | |
| } | |
| base_path = "c:/Users/LOQ/OneDrive/Desktop/agentscope/src/agentscope/model/" | |
| for folder in ["_groq", "_openrouter", "_nvidia_nim"]: | |
| folder_path = os.path.join(base_path, folder, "_models") | |
| if os.path.exists(folder_path): | |
| for file in os.listdir(folder_path): | |
| if file in model_info: | |
| name, label, context = model_info[file] | |
| content = template.format(name=name, label=label, context_size=context) | |
| with open(os.path.join(folder_path, file), "w", encoding="utf-8") as f: | |
| f.write(content) | |
| print(f"Updated {file}") | |