khang119966 commited on
Commit
d85ac0d
·
verified ·
1 Parent(s): acaae82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -17
app.py CHANGED
@@ -274,7 +274,7 @@ We currently only support one image at the start of the context! Please start a
274
  for char in thinking:
275
  temp_text += char
276
  yield accumulated_text + temp_text + "\n</code></pre>\n\n---\n"
277
- time.sleep(0.002)
278
 
279
  accumulated_text += temp_text + "\n</code></pre>\n\n---\n"
280
 
@@ -285,7 +285,7 @@ We currently only support one image at the start of the context! Please start a
285
  for char in conclusion_part:
286
  temp_text += char
287
  yield accumulated_text + temp_text + "\n\n---\n"
288
- time.sleep(0.01)
289
 
290
  accumulated_text += temp_text + "\n\n---\n"
291
 
@@ -319,10 +319,6 @@ CSS ="""
319
  height: 10dvh !important;
320
  }
321
 
322
- #think-button {
323
- width: 40% !important;
324
- }
325
-
326
  /* Đảm bảo ảnh bên trong nút hiển thị đúng cách cho các nút có aria-label chỉ định */
327
  button.svelte-1lcyrx4[aria-label="user's message: a file of type image/jpeg, "] img.svelte-1pijsyv {
328
  width: 100%;
@@ -384,21 +380,12 @@ function forceLightTheme() {
384
  }
385
  """
386
 
387
- # def toggle_think_mode(current_state):
388
- # global global_think_mode
389
- # new_state = not current_state
390
- # global_think_mode = not global_think_mode
391
- # button_label = "🧠Think💡" if new_state else "🧠Think"
392
- # return new_state, button_label
393
-
394
  def toggle_think_mode(current_state):
395
  global global_think_mode
396
  new_state = not current_state
397
- global_think_mode = new_state
398
  button_label = "🧠Think💡" if new_state else "🧠Think"
399
- # Khi Think Mode bật, đổi nền chat thành đỏ, khi tắt quay về mặc định
400
- chat_bg_color = "#ffcccc" if new_state else "#ffffff"
401
- return new_state, button_label, gr.update(css=f"body {{ background-color: {chat_bg_color}; }}")
402
 
403
  demo = gr.Blocks(css=CSS,js=js, theme='NoCrypt/miku')
404
 
 
274
  for char in thinking:
275
  temp_text += char
276
  yield accumulated_text + temp_text + "\n</code></pre>\n\n---\n"
277
+ time.sleep(0.0002)
278
 
279
  accumulated_text += temp_text + "\n</code></pre>\n\n---\n"
280
 
 
285
  for char in conclusion_part:
286
  temp_text += char
287
  yield accumulated_text + temp_text + "\n\n---\n"
288
+ time.sleep(0.001)
289
 
290
  accumulated_text += temp_text + "\n\n---\n"
291
 
 
319
  height: 10dvh !important;
320
  }
321
 
 
 
 
 
322
  /* Đảm bảo ảnh bên trong nút hiển thị đúng cách cho các nút có aria-label chỉ định */
323
  button.svelte-1lcyrx4[aria-label="user's message: a file of type image/jpeg, "] img.svelte-1pijsyv {
324
  width: 100%;
 
380
  }
381
  """
382
 
 
 
 
 
 
 
 
383
  def toggle_think_mode(current_state):
384
  global global_think_mode
385
  new_state = not current_state
386
+ global_think_mode = not global_think_mode
387
  button_label = "🧠Think💡" if new_state else "🧠Think"
388
+ return new_state, button_label
 
 
389
 
390
  demo = gr.Blocks(css=CSS,js=js, theme='NoCrypt/miku')
391