File tree Expand file tree Collapse file tree
python-ecosystem/rag-pipeline/src/rag_pipeline/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,11 +29,12 @@ def create_embedding_model(config: RAGConfig) -> BaseEmbedding:
2929 provider = config .embedding_provider .lower ()
3030
3131 if provider == "ollama" :
32- logger .info (f"Creating Ollama embedding model: { config .ollama_model } " )
32+ timeout = float (os .getenv ("OLLAMA_TIMEOUT" , "120" ))
33+ logger .info (f"Creating Ollama embedding model: { config .ollama_model } (timeout={ timeout } s)" )
3334 return OllamaEmbedding (
3435 model = config .ollama_model ,
3536 base_url = config .ollama_base_url ,
36- timeout = 120.0 ,
37+ timeout = timeout ,
3738 expected_dim = config .embedding_dim
3839 )
3940
@@ -51,10 +52,11 @@ def create_embedding_model(config: RAGConfig) -> BaseEmbedding:
5152
5253 else :
5354 logger .warning (f"Unknown embedding provider '{ provider } ', defaulting to Ollama" )
55+ timeout = float (os .getenv ("OLLAMA_TIMEOUT" , "120" ))
5456 return OllamaEmbedding (
5557 model = config .ollama_model ,
5658 base_url = config .ollama_base_url ,
57- timeout = 120.0 ,
59+ timeout = timeout ,
5860 expected_dim = config .embedding_dim
5961 )
6062
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ def __init__(
3636 api_key : str ,
3737 model : str = "openai/text-embedding-3-small" ,
3838 api_base : str = "https://openrouter.ai/api/v1" ,
39- timeout : float = 60.0 ,
39+ timeout : float = float ( os . getenv ( "OPENROUTER_TIMEOUT" , "300" )) ,
4040 max_retries : int = 3 ,
4141 embed_batch_size : int = EMBEDDING_BATCH_SIZE ,
4242 expected_dim : Optional [int ] = None ,
You can’t perform that action at this time.
0 commit comments