Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
80 |
-
|
|
|
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()
|
|