Metal3d commited on
Commit
73839bd
·
unverified ·
1 Parent(s): bc76ed6

Fixes heading

Browse files
Files changed (1) hide show
  1. main.py +6 -3
main.py CHANGED
@@ -89,6 +89,7 @@ def chat(prompt, history):
89
  buffer = ""
90
  reasoning = ""
91
  thinking = False
 
92
 
93
  for new_text in streamer:
94
  if not thinking and "<think>" in new_text:
@@ -100,12 +101,14 @@ def chat(prompt, history):
100
 
101
  if thinking:
102
  reasoning += new_text
103
- heading = "# Reasoning\n\n"
104
- yield "I'm thinking, please wait a moment...", heading + reasoning
 
 
105
  continue
106
 
107
  buffer += new_text
108
- yield reformat_math(buffer), reasoning
109
 
110
 
111
  chat_bot = gr.Chatbot(
 
89
  buffer = ""
90
  reasoning = ""
91
  thinking = False
92
+ reasoning_heading = "# Reasoning\n\n"
93
 
94
  for new_text in streamer:
95
  if not thinking and "<think>" in new_text:
 
101
 
102
  if thinking:
103
  reasoning += new_text
104
+ yield (
105
+ "I'm thinking, please wait a moment...",
106
+ reasoning_heading + reasoning,
107
+ )
108
  continue
109
 
110
  buffer += new_text
111
+ yield reformat_math(buffer), reasoning_heading + reasoning
112
 
113
 
114
  chat_bot = gr.Chatbot(