Spaces:
Runtime error
Runtime error
Update app.py
Browse files2 unmodified lines34567899101112131 unmodified line151617181920212 unmodified linesfrom huggingface_hub import InferenceClient
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")#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."}] #change the personality if history: messages.extend(history)1 unmodified line messages.append({"role":"user", "content": message})
response = client.chat_completion(messages, max_tokens=100) # change length using max_tokens
print(response['choices'][0]['message']['content'].strip()) app.py+3-1