File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
examples/local_models/Docker Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1010
1111graph_config = {
1212 "llm" : {
13- "model" : "ollama/mistral " ,
13+ "model" : "ollama/llama3 " ,
1414 "temperature" : 0 ,
1515 "format" : "json" ,
16- # "model_tokens": 2000, # set context length arbitrarily,
16+ "model_tokens" : 2000 , # set context length arbitrarily,
1717 },
1818 "embeddings" : {
1919 "model" : "ollama/nomic-embed-text" ,
20- "temperature " : 0 ,
20+ "base_url " : "http://localhost:11434" ,
2121 }
2222}
2323
Original file line number Diff line number Diff line change @@ -92,7 +92,13 @@ def execute(self, state):
9292 elif isinstance (embedding_model , AzureOpenAI ):
9393 embeddings = AzureOpenAIEmbeddings ()
9494 elif isinstance (embedding_model , Ollama ):
95- embeddings = OllamaEmbeddings (model = embedding_model .model )
95+ # unwrap the kwargs from the model whihc is a dict
96+ params = embedding_model ._lc_kwargs
97+ # remove streaming and temperature
98+ params .pop ("streaming" , None )
99+ params .pop ("temperature" , None )
100+
101+ embeddings = OllamaEmbeddings (** params )
96102 elif isinstance (embedding_model , HuggingFace ):
97103 embeddings = HuggingFaceHubEmbeddings (model = embedding_model .model )
98104 else :
You can’t perform that action at this time.
0 commit comments