Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -161,7 +161,21 @@ def chat_completions():
|
|
| 161 |
if data.get('model', "DeepSeek-R1") != "AkashGen":
|
| 162 |
text_matches = re.findall(r'0:"(.*?)"', response.text)
|
| 163 |
parsed_text = "".join(text_matches)
|
| 164 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
return Response(
|
| 166 |
json.dumps({
|
| 167 |
"object": "chat.completion",
|
|
|
|
| 161 |
if data.get('model', "DeepSeek-R1") != "AkashGen":
|
| 162 |
text_matches = re.findall(r'0:"(.*?)"', response.text)
|
| 163 |
parsed_text = "".join(text_matches)
|
| 164 |
+
print(json.dumps({
|
| 165 |
+
"object": "chat.completion",
|
| 166 |
+
"created": int(time.time() * 1000),
|
| 167 |
+
"model": data.get('model', "DeepSeek-R1"),
|
| 168 |
+
"choices": [
|
| 169 |
+
{
|
| 170 |
+
"index": 0,
|
| 171 |
+
"message": {
|
| 172 |
+
"role": "user",
|
| 173 |
+
"content": parsed_text
|
| 174 |
+
},
|
| 175 |
+
"finish_reason": "stop"
|
| 176 |
+
}
|
| 177 |
+
]
|
| 178 |
+
},ensure_ascii=False))
|
| 179 |
return Response(
|
| 180 |
json.dumps({
|
| 181 |
"object": "chat.completion",
|