Spaces:
Sleeping
Sleeping
update
Browse files
app.py
CHANGED
|
@@ -70,8 +70,8 @@ def respond(
|
|
| 70 |
if 'choices' in json_response and len(json_response['choices']) > 0:
|
| 71 |
content = json_response['choices'][0].get('message', {}).get('content', '')
|
| 72 |
if content:
|
| 73 |
-
|
| 74 |
-
|
| 75 |
print(f"[INFO] response: {content}")
|
| 76 |
return content
|
| 77 |
return "Service temporarily unavailable"
|
|
@@ -101,4 +101,4 @@ demo = gr.ChatInterface(
|
|
| 101 |
|
| 102 |
|
| 103 |
if __name__ == "__main__":
|
| 104 |
-
demo.launch(
|
|
|
|
| 70 |
if 'choices' in json_response and len(json_response['choices']) > 0:
|
| 71 |
content = json_response['choices'][0].get('message', {}).get('content', '')
|
| 72 |
if content:
|
| 73 |
+
if '<think>' in content and '</think>' in content:
|
| 74 |
+
content = content.split('</think>')[-1].strip()
|
| 75 |
print(f"[INFO] response: {content}")
|
| 76 |
return content
|
| 77 |
return "Service temporarily unavailable"
|
|
|
|
| 101 |
|
| 102 |
|
| 103 |
if __name__ == "__main__":
|
| 104 |
+
demo.launch()
|