Update utils_api.py

This commit is contained in:
Saifeddine ALOUI
2025-03-05 15:33:54 +01:00
committed by GitHub
parent 95a6a274ca
commit c62422eade

View File

@@ -17,6 +17,10 @@ from starlette.status import HTTP_403_FORBIDDEN
# Load environment variables # Load environment variables
load_dotenv(override=True) load_dotenv(override=True)
global_args={
"main_args":None
}
class OllamaServerInfos: class OllamaServerInfos:
# Constants for emulated Ollama model information # Constants for emulated Ollama model information
@@ -341,8 +345,12 @@ def parse_args(is_uvicorn_mode: bool = False) -> argparse.Namespace:
args.chunk_size = get_env_value("CHUNK_SIZE", 1200, int) args.chunk_size = get_env_value("CHUNK_SIZE", 1200, int)
args.chunk_overlap_size = get_env_value("CHUNK_OVERLAP_SIZE", 100, int) args.chunk_overlap_size = get_env_value("CHUNK_OVERLAP_SIZE", 100, int)
# Select Document loading tool
args.document_loading_tool = get_env_value("DOCUMENT_LOADING_TOOL", "DOCLING")
ollama_server_infos.LIGHTRAG_MODEL = args.simulated_model_name ollama_server_infos.LIGHTRAG_MODEL = args.simulated_model_name
global_args["main_args"]= args
return args return args