Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -139,6 +139,7 @@ global_think_mode =False
|
|
139 |
|
140 |
@spaces.GPU
|
141 |
def chat(message, history):
|
|
|
142 |
if not global_think_mode:
|
143 |
print("history",history)
|
144 |
print("message",message)
|
@@ -314,9 +315,10 @@ function forceLightTheme() {
|
|
314 |
|
315 |
# Hàm bật/tắt Think Mode
|
316 |
def toggle_think_mode(current_state):
|
|
|
317 |
new_state = not current_state
|
318 |
global_think_mode = not global_think_mode
|
319 |
-
button_label = "🧠Think💡" if new_state else "🧠Think"
|
320 |
return new_state, button_label
|
321 |
|
322 |
demo = gr.Blocks(css=CSS,js=js, theme='NoCrypt/miku')
|
@@ -328,9 +330,8 @@ with demo:
|
|
328 |
fn=chat,
|
329 |
description="""**Vintern-3B-R-beta** is the latest in the Vintern series.""",
|
330 |
examples=[
|
331 |
-
[{"text": "Hãy viết một email giới thiệu sản phẩm trong ảnh.", "files":["./demo_3.jpg"]}, False],
|
332 |
[{"text": "Trích xuất các thông tin từ ảnh trả về markdown.", "files":["./demo_1.jpg"]}, False],
|
333 |
-
[{"text": "
|
334 |
[{"text": "Trích xuất thông tin kiện hàng trong ảnh và trả về dạng JSON.", "files":["./demo_4.jpg"]}, False]
|
335 |
],
|
336 |
# additional_inputs=[think_mode],
|
|
|
139 |
|
140 |
@spaces.GPU
|
141 |
def chat(message, history):
|
142 |
+
global global_think_mode
|
143 |
if not global_think_mode:
|
144 |
print("history",history)
|
145 |
print("message",message)
|
|
|
315 |
|
316 |
# Hàm bật/tắt Think Mode
|
317 |
def toggle_think_mode(current_state):
|
318 |
+
global global_think_mode
|
319 |
new_state = not current_state
|
320 |
global_think_mode = not global_think_mode
|
321 |
+
button_label = "🧠Think💡on.." if new_state else "🧠Think"
|
322 |
return new_state, button_label
|
323 |
|
324 |
demo = gr.Blocks(css=CSS,js=js, theme='NoCrypt/miku')
|
|
|
330 |
fn=chat,
|
331 |
description="""**Vintern-3B-R-beta** is the latest in the Vintern series.""",
|
332 |
examples=[
|
|
|
333 |
[{"text": "Trích xuất các thông tin từ ảnh trả về markdown.", "files":["./demo_1.jpg"]}, False],
|
334 |
+
[{"text": "Liệt kê toàn bộ văn bản.", "files":["./demo_2.jpg"]}, False],
|
335 |
[{"text": "Trích xuất thông tin kiện hàng trong ảnh và trả về dạng JSON.", "files":["./demo_4.jpg"]}, False]
|
336 |
],
|
337 |
# additional_inputs=[think_mode],
|