Git Product home page Git Product logo

Comments (7)

VinciGit00 avatar VinciGit00 commented on September 14, 2024

ok can you show the code please?

from scrapegraph-ai.

MSR2201 avatar MSR2201 commented on September 14, 2024

from scrapegraphai.graphs import SmartScraperGraph
from scrapegraphai.utils import prettify_exec_info

graph_config = {
"llm": {
"model": "ollama/gemma2:2b",
"temperature": 1,
"format": "json", # Ollama needs the format to be specified explicitly
"model_tokens": 100, # depending on the model set context length
"base_url": "http://localhost:11434", # set ollama URL of the local host (YOU CAN CHANGE IT, if you have a different endpoint
},
"embeddings": {
"model": "ollama/nomic-embed-text",
"temperature": 0,
"base_url": "http://localhost:11434", # set ollama URL
}
}

smart_scraper_graph = SmartScraperGraph(
prompt="List me all the projects with their description.",

also accepts a string with the already downloaded HTML code

source="https://perinim.github.io/projects",
config=graph_config
)

result = smart_scraper_graph.run()
print(result)

this is the code which i used

from scrapegraph-ai.

VinciGit00 avatar VinciGit00 commented on September 14, 2024

Look at the new examples

from scrapegraph-ai.

MSR2201 avatar MSR2201 commented on September 14, 2024

Getting the same error ..

Traceback (most recent call last):
File "D:\Five minutes\firecrawl\scrapegraph\app.py", line 4, in
from scrapegraphai.graphs import SmartScraperGraph
File "D:\Five minutes\firecrawl\scrapegraph\myenv\lib\site-packages\scrapegraphai\graphs_init_.py", line 5, in
from .abstract_graph import AbstractGraph
File "D:\Five minutes\firecrawl\scrapegraph\myenv\lib\site-packages\scrapegraphai\graphs\abstract_graph.py", line 16, in

from ..utils.logging import set_verbosity_warning, set_verbosity_info
File "D:\Five minutes\firecrawl\scrapegraph\myenv\lib\site-packages\scrapegraphai\utils_init_.py", line 13, in
from .convert_to_md import convert_to_md
File "D:\Five minutes\firecrawl\scrapegraph\myenv\lib\site-packages\scrapegraphai\utils\convert_to_md.py", line 5, in
import html2text
File "D:\Five minutes\firecrawl\scrapegraph\myenv\lib\site-packages\html2text_init_.py", line 11, in
from . import config
ImportError: cannot import name 'config' from partially initialized module 'html2text' (most likely due to a circular import) (D:\Five minutes\firecrawl\scrapegraph\myenv\lib\site-packages\html2text_init_.py)

when i run the basic code without changing the code

import json
from typing import List
from langchain_core.pydantic_v1 import BaseModel, Field
from scrapegraphai.graphs import SmartScraperGraph
from scrapegraphai.utils import prettify_exec_info

class Project(BaseModel):
title: str = Field(description="The title of the project")
description: str = Field(description="The description of the project")

class Projects(BaseModel):
projects: List[Project]

graph_config = {
"llm": {
"model": "ollama/gemma2:2b",
"temperature": 0,
"format": "json", # Ollama needs the format to be specified explicitly
# "base_url": "http://localhost:11434", # set ollama URL arbitrarily
},"verbose": True,
"headless": False
}

smart_scraper_graph = SmartScraperGraph(
prompt="List me all the projects with their description",
source="https://perinim.github.io/projects/",
schema=Projects,
config=graph_config
)

result = smart_scraper_graph.run()
print(json.dumps(result, indent=4))

from scrapegraph-ai.

VinciGit00 avatar VinciGit00 commented on September 14, 2024

ok what's is your config?
can you try to use llama3?

from scrapegraph-ai.

MSR2201 avatar MSR2201 commented on September 14, 2024

my laptop is a cpu based but it should not be a problem with gemma llama is taking too much space

from scrapegraph-ai.

VinciGit00 avatar VinciGit00 commented on September 14, 2024

ok please update

from scrapegraph-ai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.