DrishtiSharma commited on
Commit
f53f431
Β·
verified Β·
1 Parent(s): 08c8080

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -60,11 +60,11 @@ def run_graph(input_message, history, user_details):
60
  q = queue.Queue()
61
  thread = threading.Thread(target=invoke_workflow, args=(q,))
62
  thread.start()
63
- thread.join(timeout=10) # Wait for 10 seconds
64
 
65
  if thread.is_alive():
66
  logger.error("Workflow timed out.")
67
- return "The request timed out. Please try again later."
68
  return q.get()
69
 
70
 
@@ -250,4 +250,4 @@ with gr.Blocks() as demo:
250
  outputs=[bmi_output, calorie_output, bmi_chart_calc]
251
  )
252
 
253
- demo.launch(share=True)
 
60
  q = queue.Queue()
61
  thread = threading.Thread(target=invoke_workflow, args=(q,))
62
  thread.start()
63
+ thread.join(timeout=30) # Wait for 30 seconds
64
 
65
  if thread.is_alive():
66
  logger.error("Workflow timed out.")
67
+ return "The request is taking longer than expected. Please try again later or modify your query."
68
  return q.get()
69
 
70
 
 
250
  outputs=[bmi_output, calorie_output, bmi_chart_calc]
251
  )
252
 
253
+ demo.launch(share=True)