Chris4K commited on
Commit
7b54480
·
verified ·
1 Parent(s): c900cf0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -266,7 +266,11 @@ def optimize_query(
266
  print('---- optimize query 4 ----')
267
  #print(llm.invoke('Hello'))
268
  # Limit max time or set a timeout for LLM to avoid endless execution
269
- optimized_queries = multi_query_retriever.invoke(query, max_time=30) # Timeout in seconds
 
 
 
 
270
  print(optimized_queries)
271
  print('---- optimize query 5 ----')
272
 
 
266
  print('---- optimize query 4 ----')
267
  #print(llm.invoke('Hello'))
268
  # Limit max time or set a timeout for LLM to avoid endless execution
269
+ try:
270
+ optimized_queries = multi_query_retriever.invoke(query, max_time=30) # Timeout in seconds
271
+ except Exception as err:
272
+ print(f"Unexpected {err=}, {type(err)=}")
273
+
274
  print(optimized_queries)
275
  print('---- optimize query 5 ----')
276