LLaMA_Server / app.py
rapacious's picture
Create app.py
0aa159f verified
raw
history blame
448 Bytes
import gradio as gr
import requests
def chat_with_llama(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_llama,
inputs="text",
outputs="text",
title="LLaMA Chatbot trên Hugging Face Space"
)
iface.launch(server_name="0.0.0.0", server_port=7860)