GenAI_Course / app.py
sam522's picture
chat
b32034a
raw
history blame
574 Bytes
import gradio as gr
from huggingface_hub import InferenceClient, login
import random
import os
login(token=os.environ["HUGGINGFACEHUB_API_TOKEN"])
"""
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
"""
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
def random_response(message, history):
return random.choice(["Yes", "No"])
demo = gr.ChatInterface(
fn=random_response,
type="messages"
)
if __name__ == "__main__":
demo.launch()