acecalisto3 commited on
Commit
b78aa21
·
verified ·
1 Parent(s): d187abc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -461,8 +461,8 @@ def chat_app_logic(message, history, purpose, agent_name, sys_prompt, temperatur
461
  Handles the chat app logic, including running the model and displaying the output.
462
  """
463
  if message:
464
- # Run the model and get the response
465
- response = generate(
466
  prompt=message,
467
  history=history,
468
  agent_name=agent_name,
@@ -471,7 +471,7 @@ def chat_app_logic(message, history, purpose, agent_name, sys_prompt, temperatur
471
  max_new_tokens=max_new_tokens,
472
  top_p=top_p,
473
  repetition_penalty=repetition_penalty,
474
- )
475
  history.append((message, response))
476
  return history
477
 
 
461
  Handles the chat app logic, including running the model and displaying the output.
462
  """
463
  if message:
464
+ # Run the model and get the response (convert generator to string)
465
+ response = ''.join(generate(
466
  prompt=message,
467
  history=history,
468
  agent_name=agent_name,
 
471
  max_new_tokens=max_new_tokens,
472
  top_p=top_p,
473
  repetition_penalty=repetition_penalty,
474
+ ))
475
  history.append((message, response))
476
  return history
477