lozanopastor commited on
Commit
37aebe6
·
verified ·
1 Parent(s): c109231

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -76,8 +76,9 @@ def user_input(user_question):
76
  # Extract the thought process
77
  thought_process = ""
78
  if "<think>" in response['output_text'] and "</think>" in response['output_text']:
79
- thought_process = re.search(r"<think>(.*?)</think>", response['output_text'], re.DOTALL)
80
- thought_process = thought_process.group(1).strip() if thought_process else ""
 
81
 
82
  # Remove the thought process from the main response
83
  clean_response = re.sub(r"<think>.*?</think>", "", response['output_text']).strip()
@@ -127,4 +128,3 @@ def main():
127
 
128
  if __name__ == "__main__":
129
  main()
130
-
 
76
  # Extract the thought process
77
  thought_process = ""
78
  if "<think>" in response['output_text'] and "</think>" in response['output_text']:
79
+ thought_process_match = re.search(r"<think>(.*?)</think>", response['output_text'], re.DOTALL)
80
+ if thought_process_match:
81
+ thought_process = thought_process_match.group(1).strip()
82
 
83
  # Remove the thought process from the main response
84
  clean_response = re.sub(r"<think>.*?</think>", "", response['output_text']).strip()
 
128
 
129
  if __name__ == "__main__":
130
  main()