Spaces:
Sleeping
Sleeping
Update app.py
Browse files1234567import gradio as grimport randomdef respond(message, history):responses = ["Yes", "No"]return random.choice(responses)chatbot = gr.ChatInterface(respond, type="messages")chatbot.launch()12345678910111213141516171819202122232425262728from huggingface_hub import InferenceClientimport gradio as grimport randomclient = InferenceClient("HuggingFaceH4/zephyr-7b-beta")def respond(message, history):#responses = ["Yes", "No"]#return random.choice(responses)messages = [{"role":"system","content": "You are a friendly chatbot!"}]if history:messages.extend(history)response = client.chat_completion(messages, max_tokens=100)return response['choices'][0]['message']['content'].strip()chatbot = gr.ChatInterface(respond, type="messages")chatbot.launch()
app.py+23-2