Spaces:
Sleeping
Sleeping
changed the LLM
Browse files1 unmodified line23456789101112131415161718196 unmodified lines262728291 unmodified lineimport randomfrom huggingface_hub import InferenceClientclient = InferenceClient("HuggingFaceH4/zephyr-7b-beta")def respond(message, history):messages = [{"role": "system", "content": "You are a friendly chatbot."}]if history:messages.extend(history)messages.append({"role": "user", "content" : message})response = client.chat_completion(messages, max_tokens = 100)print(response ["choices"][0]["message"]["content"].strip())return response ['choices'][0]['message']['content'].strip()6 unmodified lineschatbot = gr.ChatInterface(respond, type = "messages", theme = "shivi/calm_seafoam")chatbot.launch()1 unmodified line234567891011121314151617181920212223246 unmodified lines313233341 unmodified lineimport randomfrom huggingface_hub import InferenceClientclient = InferenceClient("deepseek-ai/DeepSeek-R1-Distill-Qwen-32B")# To change the LLM ^def respond(message, history):messages = [{"role": "system", "content": "You are a friendly chatbot."} # <to change the personality]if history:messages.extend(history)messages.append({"role": "user", "content" : message})response = client.chat_completion(messages, max_tokens = 100# to change the length)print(response ["choices"][0]["message"]["content"].strip())return response ['choices'][0]['message']['content'].strip()6 unmodified lineschatbot = gr.ChatInterface(respond, type = "messages", theme = "shivi/calm_seafoam")chatbot.launch(debug=True)
app.py+9-4