Comments (7)
ok can you show the code please?
from scrapegraph-ai.
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.
Look at the new examples
from scrapegraph-ai.
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.
ok what's is your config?
can you try to use llama3?
from scrapegraph-ai.
my laptop is a cpu based but it should not be a problem with gemma llama is taking too much space
from scrapegraph-ai.
ok please update
from scrapegraph-ai.
Related Issues (20)
- Token count implementation in ParseNode splits text on spaces which is not correct HOT 1
- When I use examples/deepseek/smart_scraper_deepseek.py ,I have a error. HOT 4
- v1.17.0b5: No module named 'PIL' HOT 4
- Chunking support for ScriptCreatorGraph HOT 4
- Support for OpenAI Assistants API HOT 2
- Provider bedrock is not supported when trying to use bedrock examples listed in repo. HOT 6
- Error Instancing bedrock model from example code HOT 2
- ValueError: Error raised by bedrock service: 'str' object has no attribute 'invoke_model' HOT 6
- It can´t scrape URLs from the source HOT 8
- Executing RAG Node HOT 2
- Not getting extraction results after upgrading from 1.6.1 to 1.18.1 HOT 1
- SmartScraperGraph with Gemini: Provider google is not supported in SmartScraperGraph HOT 2
- Implement tokenization for Ollama models in refactoring-tokenization branch HOT 6
- SmartScraperGraph Initialization Error HOT 3
- [Feature Request] Add a hook to customize "wait_for_load_state" behavior HOT 1
- return number of input and output tokens with the model HOT 2
- Can you collect user usage data from within the library and write it to readme HOT 4
- Cerebras and SambaNova
- Bedrock model copy recursion HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scrapegraph-ai.