Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,15 @@
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
|
4 |
-
def
|
5 |
response = requests.post("http://localhost:8000/completion", json={"prompt": prompt, "max_tokens": 100})
|
6 |
return response.json().get("text", "Không có phản hồi từ server.")
|
7 |
|
8 |
iface = gr.Interface(
|
9 |
-
fn=
|
10 |
inputs="text",
|
11 |
outputs="text",
|
12 |
-
title="
|
13 |
)
|
14 |
|
15 |
iface.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
|
4 |
+
def chat_with_qwen(prompt):
|
5 |
response = requests.post("http://localhost:8000/completion", json={"prompt": prompt, "max_tokens": 100})
|
6 |
return response.json().get("text", "Không có phản hồi từ server.")
|
7 |
|
8 |
iface = gr.Interface(
|
9 |
+
fn=chat_with_qwen,
|
10 |
inputs="text",
|
11 |
outputs="text",
|
12 |
+
title="Qwen2.5-0.5B Chatbot trên Hugging Face Space"
|
13 |
)
|
14 |
|
15 |
iface.launch(server_name="0.0.0.0", server_port=7860)
|