Spaces:
Running
Running
Upload patch_frontend.py
#3
by bep40 - opened
- patch_frontend.py +16 -1
patch_frontend.py
CHANGED
|
@@ -27,6 +27,14 @@ model_content = model_content.replace(
|
|
| 27 |
"export const DEEPSEEK_V4_PRO_MODEL_PATH = 'nvidia/nemotron-3-super-120b-a12b:free';"
|
| 28 |
)
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
# === PATCH: Add Laguna S 2.1 model path ===
|
| 31 |
if "LAGUNA_S21_MODEL_PATH" not in model_content:
|
| 32 |
model_content = model_content.replace(
|
|
@@ -150,6 +158,13 @@ NEW_MODELS = """const DEFAULT_MODEL_OPTIONS: ModelOption[] = [
|
|
| 150 |
modelPath: 'openai/google/gemini-2.0-flash-001',
|
| 151 |
avatarUrl: 'https://huggingface.co/api/avatars/google',
|
| 152 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 153 |
];"""
|
| 154 |
|
| 155 |
content = content[:match.start()] + NEW_MODELS + content[match.end():]
|
|
@@ -166,4 +181,4 @@ with open(FILE, "w", encoding="utf-8") as f:
|
|
| 166 |
f.write(content)
|
| 167 |
|
| 168 |
print("OK: Frontend patched - Tencent HY3:free DEFAULT")
|
| 169 |
-
print(" Models: HY3:free, Gemma 4 31B:free, Llama 3.3 70B:free, Laguna M.1:free, Laguna S 2.1:free, Nex N2 Mini, Ling 3.0 Flash:free, Llama 3.1 8B")
|
|
|
|
| 27 |
"export const DEEPSEEK_V4_PRO_MODEL_PATH = 'nvidia/nemotron-3-super-120b-a12b:free';"
|
| 28 |
)
|
| 29 |
|
| 30 |
+
# Add DeepSeek V4 Flash latest model path
|
| 31 |
+
if "DEEPSEEK_V4_FLASH_LATEST_MODEL_PATH" not in model_content:
|
| 32 |
+
model_content = model_content.replace(
|
| 33 |
+
"export const LAGUNA_S21_MODEL_PATH",
|
| 34 |
+
"export const DEEPSEEK_V4_FLASH_LATEST_MODEL_PATH = 'openai/deepseek/deepseek-v4-flash-latest';\n\nexport const LAGUNA_S21_MODEL_PATH"
|
| 35 |
+
)
|
| 36 |
+
print("OK: Added DEEPSEEK_V4_FLASH_LATEST_MODEL_PATH")
|
| 37 |
+
|
| 38 |
# === PATCH: Add Laguna S 2.1 model path ===
|
| 39 |
if "LAGUNA_S21_MODEL_PATH" not in model_content:
|
| 40 |
model_content = model_content.replace(
|
|
|
|
| 158 |
modelPath: 'openai/google/gemini-2.0-flash-001',
|
| 159 |
avatarUrl: 'https://huggingface.co/api/avatars/google',
|
| 160 |
},
|
| 161 |
+
{
|
| 162 |
+
id: 'deepseek-v4-flash-latest',
|
| 163 |
+
name: 'DeepSeek V4 Flash latest',
|
| 164 |
+
modelPath: 'openai/deepseek/deepseek-v4-flash-latest',
|
| 165 |
+
avatarUrl: 'https://huggingface.co/api/avatars/deepseek',
|
| 166 |
+
recommended: true,
|
| 167 |
+
},
|
| 168 |
];"""
|
| 169 |
|
| 170 |
content = content[:match.start()] + NEW_MODELS + content[match.end():]
|
|
|
|
| 181 |
f.write(content)
|
| 182 |
|
| 183 |
print("OK: Frontend patched - Tencent HY3:free DEFAULT")
|
| 184 |
+
print(" Models: HY3:free, Gemma 4 31B:free, Llama 3.3 70B:free, Laguna M.1:free, Laguna S 2.1:free, Nex N2 Mini, Ling 3.0 Flash:free, Llama 3.1 8B, DeepSeek V4 Flash latest")
|