bep40 commited on
Commit
8dbf890
·
verified ·
1 Parent(s): c7a9183

Upload patch_space_bunny.py

Browse files
Files changed (1) hide show
  1. patch_space_bunny.py +56 -0
patch_space_bunny.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Patch frontend: add stealth/space-bunny-alpha beside Laguna S 2.1.
2
+
3
+ The model uses the same OpenRouter-style `openai/` model path convention as
4
+ Laguna S 2.1 (`openai/poolside/laguna-s-2.1:free`).
5
+ """
6
+
7
+ import os
8
+
9
+ FILE = "/source/frontend/src/components/Chat/ChatInput.tsx"
10
+
11
+
12
+ def patch():
13
+ if not os.path.exists(FILE):
14
+ print(f"SKIP: {FILE} not found")
15
+ return
16
+
17
+ with open(FILE, "r", encoding="utf-8") as f:
18
+ content = f.read()
19
+
20
+ if "space-bunny-alpha" in content:
21
+ print("OK: stealth/space-bunny-alpha already present")
22
+ return
23
+
24
+ anchor = (
25
+ " {\n"
26
+ " id: 'laguna-s21',\n"
27
+ " name: 'Laguna S 2.1:free',\n"
28
+ " modelPath: 'openai/poolside/laguna-s-2.1:free',\n"
29
+ " avatarUrl: 'https://huggingface.co/api/avatars/poolside',\n"
30
+ " recommended: true,\n"
31
+ " },\n"
32
+ )
33
+ new_entry = (
34
+ " {\n"
35
+ " id: 'space-bunny-alpha',\n"
36
+ " name: 'stealth/space-bunny-alpha',\n"
37
+ " modelPath: 'openai/stealth/space-bunny-alpha',\n"
38
+ " avatarUrl: 'https://huggingface.co/api/avatars/stealth',\n"
39
+ " recommended: true,\n"
40
+ " },\n"
41
+ )
42
+
43
+ if anchor in content:
44
+ content = content.replace(anchor, anchor + new_entry, 1)
45
+ print("OK: added stealth/space-bunny-alpha after Laguna S 2.1")
46
+ else:
47
+ print("FAIL: could not find Laguna S 2.1 model entry")
48
+ return
49
+
50
+ with open(FILE, "w", encoding="utf-8") as f:
51
+ f.write(content)
52
+ print("OK: ChatInput.tsx patched")
53
+
54
+
55
+ if __name__ == "__main__":
56
+ patch()