Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -192,7 +192,7 @@ Hãy trả lời rất dài theo định dạng sau:
|
|
192 |
@spaces.GPU(duration=120)
|
193 |
def chat(message, history):
|
194 |
global global_think_mode
|
195 |
-
|
196 |
print("history",history)
|
197 |
print("message",message)
|
198 |
|
@@ -215,7 +215,7 @@ We currently only support one image at the start of the context! Please start a
|
|
215 |
pixel_values = None
|
216 |
|
217 |
if not global_think_mode:
|
218 |
-
generation_config = dict(max_new_tokens= 700, do_sample=False, num_beams = 3, repetition_penalty=2.
|
219 |
|
220 |
if len(history) == 0:
|
221 |
if pixel_values is not None:
|
@@ -252,7 +252,7 @@ We currently only support one image at the start of the context! Please start a
|
|
252 |
yield generated_text_without_prompt
|
253 |
else:
|
254 |
####################################################### thinking #######################################################
|
255 |
-
generation_config = dict(max_new_tokens= 2000, do_sample=False, num_beams = 2, repetition_penalty=2.
|
256 |
|
257 |
if len(history) == 0:
|
258 |
if pixel_values is not None:
|
@@ -409,7 +409,7 @@ def toggle_think_mode(current_state):
|
|
409 |
new_state = not current_state
|
410 |
global_think_mode = not global_think_mode
|
411 |
print("global_think_mode: ",global_think_mode,"="*20)
|
412 |
-
button_label = "🧠DeepThink
|
413 |
return new_state, button_label
|
414 |
|
415 |
demo = gr.Blocks(css=CSS,js=js, theme='NoCrypt/miku')
|
|
|
192 |
@spaces.GPU(duration=120)
|
193 |
def chat(message, history):
|
194 |
global global_think_mode
|
195 |
+
print("------------------------> RUN with global_think_mode: ",global_think_mode)
|
196 |
print("history",history)
|
197 |
print("message",message)
|
198 |
|
|
|
215 |
pixel_values = None
|
216 |
|
217 |
if not global_think_mode:
|
218 |
+
generation_config = dict(max_new_tokens= 700, do_sample=False, num_beams = 3, repetition_penalty=2.5)
|
219 |
|
220 |
if len(history) == 0:
|
221 |
if pixel_values is not None:
|
|
|
252 |
yield generated_text_without_prompt
|
253 |
else:
|
254 |
####################################################### thinking #######################################################
|
255 |
+
generation_config = dict(max_new_tokens= 2000, do_sample=False, num_beams = 2, repetition_penalty=2.5)
|
256 |
|
257 |
if len(history) == 0:
|
258 |
if pixel_values is not None:
|
|
|
409 |
new_state = not current_state
|
410 |
global_think_mode = not global_think_mode
|
411 |
print("global_think_mode: ",global_think_mode,"="*20)
|
412 |
+
button_label = "🧠DeepThink💡💡💡" if new_state else "🧠Think"
|
413 |
return new_state, button_label
|
414 |
|
415 |
demo = gr.Blocks(css=CSS,js=js, theme='NoCrypt/miku')
|