File size: 574 Bytes
67c6de9
e94f0c8
b32034a
e94f0c8
 
7f35276
67c6de9
 
 
 
 
 
 
b32034a
 
67c6de9
 
b32034a
 
67c6de9
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()