MindbloomAI commited on
Commit
44b73e1
·
verified ·
1 Parent(s): 11b8ccd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -441,6 +441,10 @@ with gr.Blocks(title="Office Conversation Helper") as demo:
441
  portuguese_json = json.dumps(portuguese_scenario, indent=2, sort_keys=False, ensure_ascii=False)
442
 
443
  return portuguese_json, portuguese_json
 
 
 
 
444
 
445
 
446
  def chat(model_choice: str, user_text: str, audio, history: List[Dict], portuguese_json: str):
 
441
  portuguese_json = json.dumps(portuguese_scenario, indent=2, sort_keys=False, ensure_ascii=False)
442
 
443
  return portuguese_json, portuguese_json
444
+ except Exception as e:
445
+ # Handle any errors during generation
446
+ error_msg = f"Error generating Portuguese scenario: {str(e)}"
447
+ return error_msg, ""
448
 
449
 
450
  def chat(model_choice: str, user_text: str, audio, history: List[Dict], portuguese_json: str):