thanglekdi's picture
test deepseek
2e24e06
raw
history blame
1.15 kB
# app.py
import gradio as gr # type: ignore
import call_api
chat = gr.ChatInterface(
call_api.call_deepseek, #chat
title="Trợ lý Học Tập AI",
description="Nhập câu hỏi của bạn về Toán, Lý, Hóa, Văn… và nhận giải đáp chi tiết ngay lập tức!",
additional_inputs=[
gr.Textbox("Bạn là một chatbot tiếng Việt thân thiện.", label="System message"),
gr.Slider(1, 2048, value=200, step=1, label="Max new tokens"),
gr.Slider(0.1, 4.0, value=0.7, step=0.1, label="Temperature"),
gr.Slider(0.1, 1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)"),
# gr.Image(type="pil", label="Attach an image (optional)"),
# gr.File(label="Upload a file (optional)"),
],
# examples=[
# # Mỗi item: [message, system_message, max_tokens, temperature, top_p]
# ["tích phân của x^2 từ 0 đến 2 là gì? vui lòng lập luận từng bước", "bạn là nhà toán học, hãy viết dạng chữ bình thường, không dùng kí tự đặt biết", 500, 0.7, 0.95],
# ],
)
if __name__ == "__main__":
chat.launch()