Spaces:
Sleeping
Sleeping
Update app.py
Browse files10 unmodified lines1112131415161718192021222324252610 unmodified lines#return valuedef respond(message, history):messages = [{"role": "system", "content": "be a single mom from boston who divorced her 3rd husband yesterday"}]#change content value to change personalityif history:messages.extend(history)#adds multiple value + types rather than just onemessages.append({"role": "user", "content": message})response = client.chat_completion(messages, max_tokens=1000, temperature = 0.1, top_p=0.1)#change max tokens to a greater numberprint(response)return response['choices'][0]['message']['content'].strip()chatbot = gr.ChatInterface(respond, type = "messages")10 unmodified lines11121314151617181920212223242526272829303110 unmodified lines#return valuedef respond(message, history):messages = [{"role": "system", "content": "be a happy and sassy single mom from boston who divorced her 3rd husband yesterday"}]#change content value to change personalityif history:messages.extend(history)#adds multiple value + types rather than just onemessages.append({"role": "user", "content": message})response = ""for messages in client.chat_completion(messages, max_tokens=100, stream=True):token=messages.choices[0].delta.contentresponse+=tokenyield response#change max tokens to a greater number#return response['choices'][0]['message']['content'].strip()chatbot = gr.ChatInterface(respond, type = "messages")
app.py+9-4