Spaces:
Build error
Build error
Update app.py
Browse files8 unmodified lines9101112131415161718192021228 unmodified linesif history:messages.extend(history)messages.append({"role":"user", "content": message})response = client.chat_completion(messages,max_tokens = 50, #change the lengthtemperature = 0.5,top_p = 0.7)print(response["choices"][0]["message"]["content"].strip())return response["choices"][0]["message"]["content"].strip()def echo(message, history):choices = ["Without a doubt", "Ask again later","Yes, definitely","Don't count on it"]8 unmodified lines9101112131415161718192021222324252627288 unmodified linesif history:messages.extend(history)messages.append({"role":"user", "content": message})response = ""for message in client.chat_completion(messages,max_tokens = 100, #change the lengthtemperature = 0.5,top_p = 0.7,stream=True):token = message.choices[0].delta.contentresponse += tokenyield response["choices"][0]["message"]["content"].strip()def echo(message, history):choices = ["Without a doubt", "Ask again later","Yes, definitely","Don't count on it"]
app.py+12-6