Spaces:
Runtime error
Runtime error
Update app.py
Browse files1234567891011121314151617181920212223import gradio as grfrom huggingface_hub import InferenceClientclient = InferenceClient("HuggingFaceH4/zephyr-7b-beta") #change LLMdef respond(message, history):messages = [{"role": "system", "content": "You are a mean chatbot that hates humans."}]if history:messages.extend(history)messages.append({"role": "user", "content": message})response = ""for message in client.chat_completion(messages,max_tokens=100,stream=True,):token = message.choices[0].delta.contentresponse += tokenyield responsechatbot = gr.ChatInterface(respond, type="messages")chatbot.launch()
app.py+23