-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in SmartScraperGraph: TypeError: unsupported operand type(s) for -: 'str' and 'int' #876
Comments
Hello, @d-sutariya! I'm here to help you with any bugs, questions, or contributions. To resolve the def __init__(
self,
input: str,
output: List[str],
node_config: Optional[dict] = None,
node_name: str = "ParseNode",
):
super().__init__(node_name, "node", input, output, 1, node_config)
self.verbose = (
False if node_config is None else node_config.get("verbose", False)
)
self.parse_html = (
True if node_config is None else node_config.get("parse_html", True)
)
self.parse_urls = (
False if node_config is None else node_config.get("parse_urls", False)
)
self.llm_model = node_config.get("llm_model")
self.chunk_size = int(node_config.get("chunk_size", 0)) # Ensure chunk_size is an integer This change ensures that To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Hey @d-sutariya, I noticed in your code you are setting the model_tokens as the hugging face api key, please try addding an integer chink size. the following is the issue in your code: graph_config = {
"llm": {
"model_instance": llm_model_instance,
"model_tokens": "YOUR_HUGGINGFACE_API_KEY" #<-- ERROR HERE
},
"embeddings": {
"model_instance": embedder_model_instance
},
"verbose": True
} |
@PeriniM Can you tell me what to enter in the model_tokens? |
@PeriniM In the example documentation model_tokens is not provided:- |
You can also remove the embedded, they are not required anymore |
I encountered a TypeError when running the SmartScraperGraph pipeline in the ScrapeGraphAI library. The error message is as follows:
This error suggests that the chunk_size variable is expected to be an integer but is treated as a string, leading to an invalid subtraction operation.
Steps to Reproduce:
The issue occurs on both Windows 11 and Ubuntu 24.04 with the following code snippet:
Environment:
The text was updated successfully, but these errors were encountered: