Skip to content

Commit ac099e2

Browse files
committed
fixed ollama embedder params
1 parent fe0b6d4 commit ac099e2

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

examples/local_models/Docker/smart_scraper_docker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111
graph_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

scrapegraphai/nodes/rag_node.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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:

0 commit comments

Comments
 (0)