Skip to content

Commit d6b8c4c

Browse files
committed
2 parents 9526ec9 + 8a15f02 commit d6b8c4c

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

scrapegraphai/graphs/abstract_graph.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,18 @@ def _create_llm(self, llm_config: dict):
6464
llm_params["model"] = llm_params["model"].split("/")[-1]
6565

6666
# allow user to set model_tokens in config
67-
if "model_tokens" in llm_params:
68-
self.model_token = llm_params["model_tokens"]
69-
elif llm_params["model"] in models_tokens["ollama"]:
70-
try:
71-
self.model_token = models_tokens["ollama"][llm_params["model"]]
72-
except KeyError:
73-
raise KeyError("Model not supported")
67+
try:
68+
if "model_tokens" in llm_params:
69+
self.model_token = llm_params["model_tokens"]
70+
elif llm_params["model"] in models_tokens["ollama"]:
71+
try:
72+
self.model_token = models_tokens["ollama"][llm_params["model"]]
73+
except KeyError:
74+
raise KeyError("Model not supported")
75+
else:
76+
self.model_token = 8192
77+
except AttributeError:
78+
self.model_token = 8192
7479

7580
return Ollama(llm_params)
7681
elif "hugging_face" in llm_params["model"]:

scrapegraphai/helpers/models_tokens.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,8 @@
3131
"dolphin-mixtral": 32000,
3232
"mistral-openorca": 32000,
3333
"stablelm-zephyr": 8192
34+
},
35+
"gemma": {
36+
"gemma": 8192,
3437
}
3538
}

0 commit comments

Comments
 (0)