mahfuj735 commited on
Commit
83e67ab
·
verified ·
1 Parent(s): 450f596
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -562,17 +562,18 @@ with gr.Blocks(css=custom_css, title="🤖 ChatGPT-like AI Assistant", theme=gr.
562
  3. **Select an assistant personality** or create your own
563
  4. **Start chatting** - the AI will remember your conversation!
564
 
565
- *Built with ❤️ for the best conversational AI experience*
566
  """)
567
 
568
  # Event handlers
569
- def submit_message(message, history, api_key, model, temperature, max_tokens, system_prompt_choice, custom_system_prompt):
570
  """Handle message submission"""
571
  if not message.strip():
572
- return history, ""
573
 
574
  # Use async generator for streaming
575
- return chat_response_stream(message, history, api_key, model, temperature, max_tokens, system_prompt_choice, custom_system_prompt)
 
576
 
577
  # In on_system_prompt_change function:
578
  def on_system_prompt_change(choice):
 
562
  3. **Select an assistant personality** or create your own
563
  4. **Start chatting** - the AI will remember your conversation!
564
 
565
+ *Built By ❤️ Mahfujul Karim*
566
  """)
567
 
568
  # Event handlers
569
+ async def submit_message(message, history, api_key, model, temperature, max_tokens, system_prompt_choice, custom_system_prompt):
570
  """Handle message submission"""
571
  if not message.strip():
572
+ yield history, ""
573
 
574
  # Use async generator for streaming
575
+ async for x in chat_response_stream(message, history, api_key, model, temperature, max_tokens, system_prompt_choice, custom_system_prompt):
576
+ yield x
577
 
578
  # In on_system_prompt_change function:
579
  def on_system_prompt_change(choice):