yzhuang commited on
Commit
dbe5296
·
verified ·
1 Parent(s): 7ab546e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -6,6 +6,7 @@ API_URL = "http://0.0.0.0:8000/v1/chat/completions"
6
  def stream_completion(message, history, max_tokens, temperature, top_p, beta):
7
  """Gradio callback: stream the assistant’s reply token-by-token."""
8
  # -------- build OpenAI-style message list (no system prompt) -------------
 
9
  for user_msg, assistant_msg in history:
10
  if user_msg: # past user turn
11
  messages.append({"role": "user", "content": user_msg})
 
6
  def stream_completion(message, history, max_tokens, temperature, top_p, beta):
7
  """Gradio callback: stream the assistant’s reply token-by-token."""
8
  # -------- build OpenAI-style message list (no system prompt) -------------
9
+ messages = []
10
  for user_msg, assistant_msg in history:
11
  if user_msg: # past user turn
12
  messages.append({"role": "user", "content": user_msg})