Spaces:
Runtime error
Runtime error
Update app.py
Browse files11234567891011121314151617181920212223print("hi")import gradio as grfrom huggingface_hub import InferenceClient
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta") #change LLM
def respond(message, history): messages = [{"role": "system", "content": "You are a chatbot that is assisting teenagers in preparing for job interviews. Be professional and kind while giving constructive feedback."}] if history: messages.extend(history) messages.append({"role": "user", "content": message}) response = "" for message in client.chat_completion( messages, max_tokens=1000, stream=True, ): token = message.choices[0].delta.content response += token yield response
chatbot = gr.ChatInterface(respond, type="messages")chatbot.launch()app.py+23-1