Spaces:
Sleeping
Sleeping
Update app.py
Browse files21 unmodified lines222324252526272829303132323334353536373815 unmodified lines54555657575821 unmodified lines
messages.append({"role": "user", "content": message})
# Get the response from the model (with stream=False) # Get a single complete response (disable streaming) response = "" response_data = client.chat_completion( messages, max_tokens=max_tokens, temperature=temperature, top_p=top_p, stream=False # Ensure we get the full response, not a stream stream=False # Disable streaming to ensure a complete response at once )
# Collect the full response # Get the full content of the answer from the response response = response_data["choices"][0]["message"]["content"]
return response15 unmodified lines ],)
demo.launch()if __name__ == "__main__": demo.launch(server_name="0.0.0.0", server_port=7860)app.py+5-4