nanova commited on
Commit
1f1d286
·
1 Parent(s): 12d1dd5
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -68,8 +68,10 @@ def respond(
68
  json_response = r.json()
69
  if 'choices' in json_response and len(json_response['choices']) > 0:
70
  content = json_response['choices'][0].get('message', {}).get('content', '')
71
- print(f"[INFO] response: {content}")
72
  if content:
 
 
 
73
  return content
74
  return "Service temporarily unavailable"
75
  except Exception as e:
 
68
  json_response = r.json()
69
  if 'choices' in json_response and len(json_response['choices']) > 0:
70
  content = json_response['choices'][0].get('message', {}).get('content', '')
 
71
  if content:
72
+ if '<think>' in content and '</think>' in content:
73
+ content = content.split('</think>')[-1].strip()
74
+ print(f"[INFO] response: {content}")
75
  return content
76
  return "Service temporarily unavailable"
77
  except Exception as e: