Skip to content

Commit 849ae42

Browse files
authored
Merge pull request #591 from jamie-beck/jamie-beck-patch-1
fix model_tokens not being used for ollama
2 parents 869bbd7 + 2a602a1 commit 849ae42

File tree

4 files changed

+13
-23
lines changed

4 files changed

+13
-23
lines changed

CHANGELOG.md

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
## [1.15.0-beta.3](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.15.0-beta.2...v1.15.0-beta.3) (2024-08-24)
1+
## [1.14.1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.14.0...v1.14.1) (2024-08-24)
2+
23

34

45
### Bug Fixes
56

7+
68
* update abstract graph ([86fe5fc](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/86fe5fcaf1a6ba28786678874378f07fba1db40f))
79

810
## [1.15.0-beta.2](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.15.0-beta.1...v1.15.0-beta.2) (2024-08-23)
@@ -17,25 +19,8 @@
1719

1820
* added sponsors ([b3a2d0d](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/b3a2d0d65a41f6e645fac3fc84f702fdf64b951c))
1921

20-
## [1.15.0-beta.1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.14.1-beta.1...v1.15.0-beta.1) (2024-08-23)
21-
22-
23-
### Features
24-
25-
* ligthweigthing the library ([62f32e9](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/62f32e994bcb748dfef4f7e1b2e5213a989c33cc))
26-
27-
28-
### Bug Fixes
29-
30-
* Azure OpenAI issue ([a92b9c6](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/a92b9c6970049a4ba9dbdf8eff3eeb7f98c6c639))
31-
32-
## [1.14.1-beta.1](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.14.0...v1.14.1-beta.1) (2024-08-21)
33-
34-
35-
### Bug Fixes
36-
37-
* **models_tokens:** add llama2 and llama3 sizes explicitly ([b05ec16](https://github.com/ScrapeGraphAI/Scrapegraph-ai/commit/b05ec16b252d00c9c9ee7c6d4605b420851c7754))
3822

23+
#
3924
## [1.14.0](https://github.com/ScrapeGraphAI/Scrapegraph-ai/compare/v1.13.3...v1.14.0) (2024-08-20)
4025

4126

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[project]
22
name = "scrapegraphai"
3-
version = "1.15.0b3"
3+
4+
5+
version = "1.14.1"
6+
47
description = "A web scraping library based on LangChain which uses LLM and direct graph logic to create scraping pipelines."
58
authors = [
69
{ name = "Marco Vinciguerra", email = "[email protected]" },

scrapegraphai/graphs/abstract_graph.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@ def handle_model(model_name, provider, token_key, default_token=8192):
169169

170170
elif "ollama" in llm_params["model"]:
171171
model_name = llm_params["model"].split("ollama/")[-1]
172-
token_key = model_name if "model_tokens" not in llm_params else llm_params["model_tokens"]
173-
return handle_model(model_name, "ollama", token_key)
172+
token_key = model_name if "model_tokens" not in llm_params else None
173+
explicit_model_tokens = 8192 if "model_tokens" not in llm_params else llm_params["model_tokens"]
174+
return handle_model(model_name, "ollama", token_key, explicit_model_tokens)
174175

175176
elif "claude-3-" in llm_params["model"]:
176177
return handle_model(llm_params["model"], "anthropic", "claude3")
@@ -268,4 +269,4 @@ def _create_graph(self):
268269
def run(self) -> str:
269270
"""
270271
Abstract method to execute the graph and return the result.
271-
"""
272+
"""

scrapegraphai/helpers/models_tokens.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
"claude-3-5-sonnet-20240620": 200000,
139139
},
140140
"bedrock": {
141+
"anthropic.claude-3-5-sonnet-20240620": 200000,
141142
"anthropic.claude-3-haiku-20240307-v1:0": 200000,
142143
"anthropic.claude-3-sonnet-20240229-v1:0": 200000,
143144
"anthropic.claude-3-opus-20240229-v1:0": 200000,

0 commit comments

Comments
 (0)