Skip to content

Commit 47a34ac

Browse files
committed
add new models and import
1 parent 8a92383 commit 47a34ac

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

scrapegraphai/helpers/mappings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"llama2": "isenbek/lama-2-7b-chat-hf-local-1",
66
"llama3": "meta-llama/Meta-Llama-3-8B",
77
"llama3:70b": "meta-llama/Meta-Llama-3-70B",
8+
"llama3.1":"meta-llama/Meta-Llama-3.1-8B",
89
"llama3.1:70b":"meta-llama/Meta-Llama-3.1-70B",
910
"mistral": "mistralai/Mistral-Nemo-Instruct-2407"
10-
}
11+
}

scrapegraphai/nodes/parse_node.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from ..helpers import models_tokens
1616
from ..utils.tokenizer_openai import num_tokens_openai
1717
from .base_node import BaseNode
18+
from ..helpers.mappings import translation_hf
1819

1920
class ParseNode(BaseNode):
2021
"""
@@ -102,7 +103,7 @@ def execute(self, state: dict) -> dict:
102103
elif isinstance(self.llm_model, ChatMistralAI):
103104
print("mistral")
104105
elif isinstance(self.llm_model, ChatOllama):
105-
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Meta-Llama-3-8B")
106+
tokenizer = AutoTokenizer.from_pretrained(translation_hf[self.llm_model.split("/")[-1]])
106107
tokens = tokenizer.tokenize(docs_transformed.page_conten)
107108
num_tokens = len(tokens)
108109
#google genai

0 commit comments

Comments
 (0)