Spaces:
Sleeping
Sleeping
changed the LLM
Browse files1 unmodified line2345567899101112131415161517181920212223246 unmodified lines31323329341 unmodified lineimport randomfrom huggingface_hub import InferenceClient
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")client = 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."}] 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) 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 lines
chatbot = gr.ChatInterface(respond, type = "messages", theme = "shivi/calm_seafoam")
chatbot.launch()chatbot.launch(debug=True)app.py+9-4