Spaces:
Sleeping
Sleeping
adding temperature and top_p
Browse files4 unmodified lines56789101112131415164 unmodified linesclient = InferenceClient ("Qwen/Qwen2.5-72B-Instruct") #change the LLMdef respond(message, history):messages = [{"role" : "system", "content" : "You are a chatbot."}] #change personalityif history:messages.extend(history)messages.append({"role" : "user", "content" : message})response = client.chat_completion(messages, max_tokens = 10) #change lengthprint(response["choices"][0]["message"]["content"].strip())return response["choices"][0]["message"]["content"].strip()4 unmodified lines56789101112131415164 unmodified linesclient = InferenceClient ("Qwen/Qwen2.5-72B-Instruct") #change the LLMdef respond(message, history):messages = [{"role" : "system", "content" : "You are a sassy chatbot."}] #change personalityif history:messages.extend(history)messages.append({"role" : "user", "content" : message})response = client.chat_completion(messages, max_tokens = 10, temperature = 0.9, top_p = 0.7) #change lengthprint(response["choices"][0]["message"]["content"].strip())return response["choices"][0]["message"]["content"].strip()
app.py+2-2