khang119966 commited on
Commit
926df70
·
verified ·
1 Parent(s): ae3770a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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.0)
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.0)
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💡" if new_state else "🧠Think"
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')