mariusjabami commited on
Commit
7394990
·
verified ·
1 Parent(s): 6e60b60

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -74,7 +74,7 @@ button.pulse:hover {
74
  with gr.Blocks(css=css) as demo:
75
 
76
  gr.Markdown("<h1 style='text-align:center;color:#e0e0e0;'>Lambdai-v1-1B Chat</h1>")
77
- chatbot = gr.Chatbot(elem_id="chatbot", height=480, render_markdown=True)
78
 
79
  with gr.Row():
80
  system_message = gr.Textbox(value="You are a helpful assistant.", label="System message", lines=1)
@@ -102,7 +102,7 @@ with gr.Blocks(css=css) as demo:
102
  f"Thinking… generating reasoning path…"
103
  f"</div>"
104
  )
105
- yield chat_history + [[message, thinking_html]]
106
 
107
  # Prepara payload para API
108
  messages = [{"role": "system", "content": system_message}]
@@ -122,7 +122,7 @@ with gr.Blocks(css=css) as demo:
122
  ):
123
  delta = chunk.choices[0].delta.content or ""
124
  response += delta
125
- yield chat_history + [[message, response]]
126
 
127
  send_button.click(
128
  fn=respond,
 
74
  with gr.Blocks(css=css) as demo:
75
 
76
  gr.Markdown("<h1 style='text-align:center;color:#e0e0e0;'>Lambdai-v1-1B Chat</h1>")
77
+ chatbot = gr.Chatbot(elem_id="chatbot", height=480, render_markdown=True, type='messages')
78
 
79
  with gr.Row():
80
  system_message = gr.Textbox(value="You are a helpful assistant.", label="System message", lines=1)
 
102
  f"Thinking… generating reasoning path…"
103
  f"</div>"
104
  )
105
+ yield chat_history + [{"role": "user", "content": message}, {"role": "assistant", "content": thinking_html}]
106
 
107
  # Prepara payload para API
108
  messages = [{"role": "system", "content": system_message}]
 
122
  ):
123
  delta = chunk.choices[0].delta.content or ""
124
  response += delta
125
+ yield chat_history + [{"role": "user", "content": message}, {"role": "assistant", "content": response}]
126
 
127
  send_button.click(
128
  fn=respond,