tferhan commited on
Commit
0462614
·
verified ·
1 Parent(s): d5f8b4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -66,7 +66,10 @@ agent = initialize_agent(
66
  )
67
 
68
  def data_gov_ma(message, history):
69
- response = agent.run(message)
70
- return response
 
 
 
71
 
72
  gr.ChatInterface(data_gov_ma).launch()
 
66
  )
67
 
68
  def data_gov_ma(message, history):
69
+ try:
70
+ response = agent.run(message)
71
+ return response
72
+ except ValueError as e:
73
+ return "Je suis désolé, je n'ai pas compris votre question. Pourriez-vous la reformuler s'il vous plaît ?"
74
 
75
  gr.ChatInterface(data_gov_ma).launch()