gradio-api / app-llama2.py
binqiangliu's picture
Rename app.py to app-llama2.py
2c76709
raw
history blame contribute delete
410 Bytes
import gradio as gr
from gradio_client import Client
import os
HUGGINGFACEHUB_API_TOKEN=os.getenv("HUGGINGFACEHUB_API_TOKEN")
client = Client("https://AIShare-aichatbot.hf.space/", hf_token=HUGGINGFACEHUB_API_TOKEN)
def chat_with_model(input_text):
result = client.predict(input_text, fn_index=1)
return result
iface = gr.Interface(fn=chat_with_model, inputs="text", outputs="text")
iface.launch()