mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-07-04 21:00:36 +08:00
fix model_tokens not being used for ollama
I am passing in the explicit model_tokens from user config as the default_token so it will correctly fallback to the users setting if the model is not found
This commit is contained in:
parent
88e76ceedb
commit
35b994a8cd
@ -174,8 +174,9 @@ class AbstractGraph(ABC):
|
||||
|
||||
elif "ollama" in llm_params["model"]:
|
||||
model_name = llm_params["model"].split("ollama/")[-1]
|
||||
token_key = model_name if "model_tokens" not in llm_params else llm_params["model_tokens"]
|
||||
return handle_model(model_name, "ollama", token_key)
|
||||
token_key = model_name if "model_tokens" not in llm_params else None
|
||||
explicit_model_tokens = 8192 if "model_tokens" not in llm_params else llm_params["model_tokens"]
|
||||
return handle_model(model_name, "ollama", token_key, explicit_model_tokens)
|
||||
|
||||
elif "claude-3-" in llm_params["model"]:
|
||||
return handle_model(llm_params["model"], "anthropic", "claude3")
|
||||
@ -271,4 +272,4 @@ class AbstractGraph(ABC):
|
||||
def run(self) -> str:
|
||||
"""
|
||||
Abstract method to execute the graph and return the result.
|
||||
"""
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user