prom-space / app.py
anish-hf-a's picture
Update app.py
c26006a verified
Raw
History Blame Contribute Delete
620 Bytes
import os
import gradio as gr
from gradio_client import Client
read_key = os.environ.get('HF_TOKEN', None)
print("gradio version:", gr.__version__)
client = Client("anish-hf-a/ml-test")
def respond(
message,
history: list[tuple[str, str]],
system_message,
max_tokens,
temperature,
top_p,
):
result = client.predict(
message=message,
api_name="/chat"
)
print(result)
yield result
"""
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
"""
demo = gr.ChatInterface(
respond,
)
demo.launch()