mirror of
https://github.com/VinciGit00/Scrapegraph-ai.git
synced 2026-07-01 21:00:48 +08:00
Fixes #752 Fix the issue with loading the tokenizer for 'gpt2'. * **scrapegraphai/utils/tokenizer.py** - Add a check for `GPT2TokenizerFast` in the `num_tokens_calculus` function. - Import `GPT2TokenizerFast` from `transformers`. * **scrapegraphai/utils/tokenizers/tokenizer_ollama.py** - Modify the `num_tokens_ollama` function to handle `GPT2TokenizerFast`. * **tests/graphs/smart_scraper_ollama_test.py** - Add a test case to verify the tokenizer loading for `GPT2TokenizerFast`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/ScrapeGraphAI/Scrapegraph-ai/issues/752?shareId=XXXX-XXXX-XXXX-XXXX). |
||
|---|---|---|
| .. | ||
| graphs | ||
| inputs | ||
| nodes | ||
| utils | ||
| Readme.md | ||
Test section
Regarding the tests for the folder graphs and nodes it was created a specific repo as a example (link of the repo). The test website is hosted here. Remember to activating Ollama and having installed the LLM on your pc
For running the tests run the command:
pytest