File size: 453 Bytes
0aa159f
 
 
f7c9c71
0aa159f
 
 
 
f7c9c71
0aa159f
 
f7c9c71
0aa159f
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr
import requests

def chat_with_qwen(prompt):
    response = requests.post("http://localhost:8000/completion", json={"prompt": prompt, "max_tokens": 100})
    return response.json().get("text", "Không có phản hồi từ server.")

iface = gr.Interface(
    fn=chat_with_qwen,
    inputs="text",
    outputs="text",
    title="Qwen2.5-0.5B Chatbot trên Hugging Face Space"
)

iface.launch(server_name="0.0.0.0", server_port=7860)