Spaces:
Sleeping
Sleeping
Update app.py
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889901 unmodified line929394959697import gradio as grimport random as rdfrom huggingface_hub import InferenceClientclient = InferenceClient("Qwen/Qwen2.5-72B-Instruct")def respond (message, history):messages = [{"role": "system", "content": "You are a chatbot who is sassy and doesnt explain an anser unless someone asks twice."}]if history:messages.extend(history)messages.append({"role": "user", "content": message})response = ""for message in client.chat_completion(messages,max_tokens=500,temperature=0.2,top_p=0.9,stream=True):token = message.choices[0].delta.contentresponse += tokenyield responsechatbot = gr.ChatInterface(respond, type = "messages")chatbot.launch(debug=True)# Define the Gradio interfacecss = """.gradio-container {1 unmodified linefont-family: 'Times New Roman', Times, serif;}"""12345678910111213141516171819202122232425261 unmodified line28293031323334353637import gradio as grimport random as rdfrom huggingface_hub import InferenceClientclient = InferenceClient("Qwen/Qwen2.5-72B-Instruct")def respond (message, history):messages = [{"role": "system", "content": "You are a chatbot who is sassy and doesnt explain an anser unless someone asks twice."}]if history:messages.extend(history)messages.append({"role": "user", "content": message})response = ""for message in client.chat_completion(messages,max_tokens=500,temperature=0.2,top_p=0.9,stream=True):token = message.choices[0].delta.contentresponse += tokenyield response# Define the Gradio interfacecss = """.gradio-container {1 unmodified linefont-family: 'Times New Roman', Times, serif;}"""chatbot = gr.ChatInterface(respond, type = "messages")chatbot.launch(debug=True)
app.py+5-65