thanglekdi commited on
Commit
a793a92
·
1 Parent(s): 257a0e0

test deepseek

Browse files
Files changed (1) hide show
  1. app.py +26 -26
app.py CHANGED
@@ -19,35 +19,35 @@ chat = gr.ChatInterface(
19
  # ],
20
  )
21
 
22
- with gr.Blocks() as demo: # Bắt đầu Blocks
23
- # Thành phần hiển thị lịch sử chat
24
- chatbot = gr.Chatbot(type="messages") # hỗ trợ subset Markdown:contentReference[oaicite:3]{index=3}
25
 
26
- # Thành phần Markdown để render kết quả đã format (Markdown + LaTeX)
27
- markdown = gr.Markdown(
28
- latex_delimiters=[{"left":"$$","right":"$$","display":True}]
29
- ) # cho phép render LaTeX:contentReference[oaicite:4]{index=4}
30
 
31
- # Các input controls
32
- with gr.Row():
33
- txt = gr.Textbox(label="Nhập câu hỏi")
34
- sys_msg = gr.Textbox(value="Bạn là một chatbot tiếng Việt thân thiện.", label="System message")
35
- with gr.Row():
36
- max_t = gr.Slider(1, 2048, value=500, step=1, label="Max new tokens")
37
- temp = gr.Slider(0.1, 4.0, value=0.7, step=0.1, label="Temperature")
38
- top_p = gr.Slider(0.1, 1.0, value=0.95, step=0.05, label="Top-p")
39
- # Inputs tuỳ chọn
40
- with gr.Row():
41
- file_up = gr.File(label="Tải lên file (tuỳ chọn)", file_count="single")
42
- img_up = gr.Image(type="pil", label="Tải lên ảnh (tuỳ chọn)")
43
 
44
- # Sự kiện submit
45
- txt.submit(
46
- call_api.call_deepseek,
47
- inputs=[txt, chatbot, sys_msg, max_t, temp, top_p, file_up, img_up],
48
- outputs=[chatbot, markdown],
49
- api_name="predict"
50
- )
51
 
52
 
53
  # Chạy app
 
19
  # ],
20
  )
21
 
22
+ # with gr.Blocks() as demo: # Bắt đầu Blocks
23
+ # # Thành phần hiển thị lịch sử chat
24
+ # chatbot = gr.Chatbot(type="messages") # hỗ trợ subset Markdown:contentReference[oaicite:3]{index=3}
25
 
26
+ # # Thành phần Markdown để render kết quả đã format (Markdown + LaTeX)
27
+ # markdown = gr.Markdown(
28
+ # latex_delimiters=[{"left":"$$","right":"$$","display":True}]
29
+ # ) # cho phép render LaTeX:contentReference[oaicite:4]{index=4}
30
 
31
+ # # Các input controls
32
+ # with gr.Row():
33
+ # txt = gr.Textbox(label="Nhập câu hỏi")
34
+ # sys_msg = gr.Textbox(value="Bạn là một chatbot tiếng Việt thân thiện.", label="System message")
35
+ # with gr.Row():
36
+ # max_t = gr.Slider(1, 2048, value=500, step=1, label="Max new tokens")
37
+ # temp = gr.Slider(0.1, 4.0, value=0.7, step=0.1, label="Temperature")
38
+ # top_p = gr.Slider(0.1, 1.0, value=0.95, step=0.05, label="Top-p")
39
+ # # Inputs tuỳ chọn
40
+ # with gr.Row():
41
+ # file_up = gr.File(label="Tải lên file (tuỳ chọn)", file_count="single")
42
+ # img_up = gr.Image(type="pil", label="Tải lên ảnh (tuỳ chọn)")
43
 
44
+ # # Sự kiện submit
45
+ # txt.submit(
46
+ # call_api.call_deepseek,
47
+ # inputs=[txt, chatbot, sys_msg, max_t, temp, top_p, file_up, img_up],
48
+ # outputs=[chatbot, markdown],
49
+ # api_name="predict"
50
+ # )
51
 
52
 
53
  # Chạy app