Skip to content
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

OSError: [WinError 126] The specified module could not be found. Error loading "C:\apps\python\lib\site-packages\torch\lib\fbgemm.dll" #15

Open
akshaybob opened this issue Aug 28, 2024 · 2 comments

Comments

@akshaybob
Copy link

from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
from parsera.engine.model import HuggingFaceModel
from parsera import Parsera

Define the URL and elements to scrape

url = "https://news.ycombinator.com/"
elements = {
"Title": "News title",
"Points": "Number of points",
"Comments": "Number of comments",
}

Initialize model with transformers pipeline

tokenizer = AutoTokenizer.from_pretrained("microsoft/Phi-3-mini-128k-instruct", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("microsoft/Phi-3-mini-128k-instruct", trust_remote_code=True)
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, max_new_tokens=5000)

Initialize HuggingFaceModel

llm = HuggingFaceModel(pipeline=pipe)

Scrapper with HuggingFace model

scrapper = Parsera(model=llm)
result = scrapper.run(url=url, elements=elements)
OSError: [WinError 126] The specified module could not be found. Error loading "C:\apps\python\lib\site-packages\torch\lib\fbgemm.dll"
tried to run the script but getting an torch related error:-

@raznem
Copy link
Owner

raznem commented Sep 6, 2024

Seems like it's a huggingface/torch issue, you can try to use Linux via docker or WSL, usually, it is much smoother there.

@danyathecoder
Copy link
Collaborator

@akshaybob, try to avoid using parsera directly on Windows. Unfortunately, python libraries doesn't work very stable on Windows, that why I could purpose you to run your code in Docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@raznem @danyathecoder @akshaybob and others