Spaces:
Runtime error
Runtime error
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() | |