ScrapeGraphAI / Scrapegraph-ai

Python scraper based on AI
https://scrapegraphai.com
MIT License
14.34k stars 1.17k forks source link

`embedder_model` AttributeError in `/examples/openai/deep_scraper_openai.py` #545

Open ajt opened 1 month ago

ajt commented 1 month ago

Describe the bug When running the OpenAI Deep Scraper example located at examples/openai/deep_scraper_openai.py, I get the error:

Traceback (most recent call last):
  File "/Users/ajt/Projects/scrapegraph_playground/openai/deep_scraper_openai.py", line 37, in <module>
    deep_scraper_graph = DeepScraperGraph(
                         ^^^^^^^^^^^^^^^^^
  File "/Users/ajt/.virtualenvs/scrapegraph-ai/lib/python3.12/site-packages/scrapegraphai/graphs/deep_scraper_graph.py", line 62, in __init__
    super().__init__(prompt, config, source, schema)
  File "/Users/ajt/.virtualenvs/scrapegraph-ai/lib/python3.12/site-packages/scrapegraphai/graphs/abstract_graph.py", line 70, in __init__
    self.graph = self._create_graph()
                 ^^^^^^^^^^^^^^^^^^^^
  File "/Users/ajt/.virtualenvs/scrapegraph-ai/lib/python3.12/site-packages/scrapegraphai/graphs/deep_scraper_graph.py", line 160, in _create_graph
    base_graph = self._create_repeated_graph()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ajt/.virtualenvs/scrapegraph-ai/lib/python3.12/site-packages/scrapegraphai/graphs/deep_scraper_graph.py", line 90, in _create_repeated_graph
    "embedder_model": self.embedder_model
                      ^^^^^^^^^^^^^^^^^^^
AttributeError: 'DeepScraperGraph' object has no attribute 'embedder_model'

To Reproduce Steps to reproduce the behavior: Fresh install on macOS. Execute the script

Expected behavior Expecting the script to execute without errors.

Desktop (please complete the following information):

Additional context I am sure that the embedder_model just needs to be set, but I am unsure how to do it.

ekinsenler commented 1 month ago

You can refer to #544 . DeepScraperGraph is currently not working as intended.