Spaces:
Running
Running
Download patch_frontend_ming_models.py from bep40/ml-intern2: direct link, hf CLI and curl.
- Browser
- Download file 2.71 kB
-
https://huggingface.co/spaces/bep40/ml-intern2/resolve/main/patch_frontend_ming_models.py
- Command line
-
hf download hf://spaces/bep40/ml-intern2/patch_frontend_ming_models.py
-
curl -L -o patch_frontend_ming_models.py https://huggingface.co/spaces/bep40/ml-intern2/resolve/main/patch_frontend_ming_models.py
2.71 kB
| """Patch frontend: add 4 new models right after the Laguna S 2.1 entry. | |
| Same `openai/`-prefix model-path convention as Laguna S 2.1 | |
| (`openai/poolside/laguna-s-2.1:free`): the backend strips the `openai/` | |
| prefix and routes the request to OpenRouter. | |
| New models: | |
| - dots-studio/dots-3-note-preview:free -> openai/dots-studio/dots-3-note-preview:free | |
| - qwen/qwen3.8-27b:free -> openai/qwen/qwen3.8-27b:free | |
| - respan/span-01-lite -> openai/respan/span-01-lite | |
| - inclusionai/ming-image-0.1-design -> openai/inclusionai/ming-image-0.1-design | |
| """ | |
| import os | |
| import sys | |
| FILE = "/source/frontend/src/components/Chat/ChatInput.tsx" | |
| MARKER = "dots-3-note-preview" | |
| if not os.path.exists(FILE): | |
| print(f"FAIL: {FILE} not found") | |
| sys.exit(1) | |
| with open(FILE, "r", encoding="utf-8") as f: | |
| content = f.read() | |
| if MARKER in content: | |
| print("OK: 4 new models already present in ChatInput.tsx (idempotent)") | |
| sys.exit(0) | |
| anchor = ( | |
| " {\n" | |
| " id: 'laguna-s21',\n" | |
| " name: 'Laguna S 2.1:free',\n" | |
| " modelPath: 'openai/poolside/laguna-s-2.1:free',\n" | |
| " avatarUrl: 'https://huggingface.co/api/avatars/poolside',\n" | |
| " recommended: true,\n" | |
| " },\n" | |
| ) | |
| new_entries = ( | |
| " {\n" | |
| " id: 'dots-3-note-preview',\n" | |
| " name: 'dots-studio/dots-3-note-preview:free',\n" | |
| " modelPath: 'openai/dots-studio/dots-3-note-preview:free',\n" | |
| " avatarUrl: 'https://huggingface.co/api/avatars/dots-studio',\n" | |
| " recommended: true,\n" | |
| " },\n" | |
| " {\n" | |
| " id: 'qwen3-8-27b',\n" | |
| " name: 'qwen/qwen3.8-27b:free',\n" | |
| " modelPath: 'openai/qwen/qwen3.8-27b:free',\n" | |
| " avatarUrl: 'https://huggingface.co/api/avatars/qwen',\n" | |
| " recommended: true,\n" | |
| " },\n" | |
| " {\n" | |
| " id: 'span-01-lite',\n" | |
| " name: 'respan/span-01-lite',\n" | |
| " modelPath: 'openai/respan/span-01-lite',\n" | |
| " avatarUrl: 'https://huggingface.co/api/avatars/respan',\n" | |
| " recommended: true,\n" | |
| " },\n" | |
| " {\n" | |
| " id: 'ming-image-0-1-design',\n" | |
| " name: 'inclusionai/ming-image-0.1-design',\n" | |
| " modelPath: 'openai/inclusionai/ming-image-0.1-design',\n" | |
| " avatarUrl: 'https://huggingface.co/api/avatars/inclusionai',\n" | |
| " recommended: true,\n" | |
| " },\n" | |
| ) | |
| if anchor in content: | |
| content = content.replace(anchor, anchor + new_entries, 1) | |
| print("OK: added 4 new models after Laguna S 2.1") | |
| else: | |
| print("FAIL: could not find Laguna S 2.1 entry in DEFAULT_MODEL_OPTIONS") | |
| sys.exit(1) | |
| with open(FILE, "w", encoding="utf-8") as f: | |
| f.write(content) | |
| print("OK: ChatInput.tsx patched with 4 new models") | |