Spaces:
Sleeping
Sleeping
Update app.py
Browse files9 unmodified lines101112131415161718192021229 unmodified linesmessages.extend(history)messages.append({"role" : "user", "content" : message})response = client.chat_completion(messages,max_tokens = 100, #change lengthtemperature = 0, #randomnesstop_p = 0.3)print(response["choices"][0]["message"]["content"].strip())return response["choices"][0]["message"]["content"].strip()9 unmodified lines1011121314151617181920212223242526272829309 unmodified linesmessages.extend(history)messages.append({"role" : "user", "content" : message})response = ""client.chat_completion(messages,max_tokens = 100, #change lengthtemperature = 0, #randomnesstop_p = 0.3stream = True)for chats in client.chat_completion:token = message.choices[0].delta.contentresponse += tokenyield responseprint(response["choices"][0]["message"]["content"].strip())return response["choices"][0]["message"]["content"].strip()
app.py+9-1