Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
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 |
|