Commit d3622fb7 authored by jyong's avatar jyong

check thread block

parent 83105d0d
......@@ -481,7 +481,7 @@ def normalization_collections():
threads.append(document_format_thread)
document_format_thread.start()
for thread in threads:
thread.join()
thread.join(timeout=30)
click.echo(click.style('Congratulations! restore {} dataset indexes.'.format(len(normalization_count)), fg='green'))
......
......@@ -135,6 +135,7 @@ class AgentExecutor:
try:
output = agent_executor.run(input=query)
logging.warning("agent_executor finished!")
except InvokeError as ex:
raise ex
except Exception as ex:
......
......@@ -662,7 +662,7 @@ class IndexingRunner:
threads.append(document_format_thread)
document_format_thread.start()
for thread in threads:
thread.join()
thread.join(timeout=30)
return all_qa_documents
return all_documents
......
......@@ -134,7 +134,7 @@ class SparkLargeLanguageModel(LargeLanguageModel):
completion += delta
thread.join()
thread.join(timeout=30)
# transform assistant message to prompt message
assistant_prompt_message = AssistantPromptMessage(
content=completion
......@@ -194,7 +194,7 @@ class SparkLargeLanguageModel(LargeLanguageModel):
)
)
thread.join()
thread.join(timeout=30)
def _to_credential_kwargs(self, credentials: dict) -> dict:
"""
......
import logging
from typing import List, Optional
from core.model_manager import ModelInstance
......@@ -39,7 +40,7 @@ class RerankRunner:
)
rerank_documents = []
logging.warning("Rerank finished!")
for result in rerank_result.docs:
# format document
rerank_document = Document(
......
import json
import logging
import threading
from typing import List, Optional, Type
......@@ -70,7 +71,7 @@ class DatasetMultiRetrieverTool(BaseTool):
threads.append(retrieval_thread)
retrieval_thread.start()
for thread in threads:
thread.join()
thread.join(timeout=30)
# do rerank for searched documents
model_manager = ModelManager()
rerank_model_instance = model_manager.get_model_instance(
......@@ -243,6 +244,6 @@ class DatasetMultiRetrieverTool(BaseTool):
full_text_index_thread.start()
for thread in threads:
thread.join()
thread.join(timeout=30)
all_documents.extend(documents)
logging.warning("DatasetMultiRetrieverTool finished!")
......@@ -140,7 +140,7 @@ class DatasetRetrieverTool(BaseTool):
full_text_index_thread.start()
for thread in threads:
thread.join()
thread.join(timeout=30)
# hybrid search: rerank after all documents have been searched
if retrieval_model['search_method'] == 'hybrid_search':
......
......@@ -93,7 +93,7 @@ class HitTestingService:
full_text_index_thread.start()
for thread in threads:
thread.join()
thread.join(timeout=30)
if retrieval_model['search_method'] == 'hybrid_search':
model_manager = ModelManager()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment