beyoru commited on
Commit
bc6e181
·
verified ·
1 Parent(s): 708434b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -62,7 +62,7 @@ def calculate_eou(chat_ctx, session):
62
  def respond(
63
  message,
64
  history: list[tuple[str, str]],
65
- max_tokens=1024,
66
  temperature=0.6,
67
  top_p=0.95,
68
  ):
@@ -89,12 +89,12 @@ def respond(
89
  stream=True,
90
  temperature=temperature,
91
  top_p=top_p,
 
92
  )
93
 
94
  for chunk in stream:
95
- token = chunk.choices[0].delta.content or ""
96
- full_response += token
97
- yield full_response # Send raw unmodified response to Gradio
98
 
99
  # This will match both console and Gradio output
100
  print(f"Final response: {full_response}")
 
62
  def respond(
63
  message,
64
  history: list[tuple[str, str]],
65
+ max_tokens=2048,
66
  temperature=0.6,
67
  top_p=0.95,
68
  ):
 
89
  stream=True,
90
  temperature=temperature,
91
  top_p=top_p,
92
+ stream=True
93
  )
94
 
95
  for chunk in stream:
96
+ print(chunk.choices[0].delta.content)
97
+ yield chunk.choices[0].delta.content # Send raw unmodified response to Gradio
 
98
 
99
  # This will match both console and Gradio output
100
  print(f"Final response: {full_response}")