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

hunflair2 model is not found #3547

Closed
YashotharaS opened this issue Sep 24, 2024 · 4 comments
Closed

hunflair2 model is not found #3547

YashotharaS opened this issue Sep 24, 2024 · 4 comments
Assignees

Comments

@YashotharaS
Copy link

Dear all,
I'm encountering the error "ValueError: Could not find any model with name 'hunflair2'" when trying to run the code tagger = Classifier.load("hunflair2") as mentioned on the GitHub page. I'm using Flair version 0.14.0, and while hunflair v1 works without issues, the code is unable to find hunflair2. Could you please help me resolve this issue?

@helpmefindaname
Copy link
Collaborator

@sg-wbi @WangXII
it looks like https://huggingface.co/hunflair/hunflair2-ner has pickeled a PosixPath and therefore cannot be loaded in Windows.
The flair trainer doesn't save paths anymore, see https://github.com/flairNLP/flair/blob/master/flair/trainers/trainer.py#L894

Can one of you execute

model = Classifier.load("hunflair2")
model.model_card["training_parameters"]["base_path"] = str(model.model_card["training_parameters"]["base_path"])
model.save("pytorch_model.bin")

and commit the new model on the HF-Hub?

@WangXII
Copy link
Collaborator

WangXII commented Sep 27, 2024

Thanks @helpmefindaname, I've committed the new model according this to hf-hub!

@helpmefindaname
Copy link
Collaborator

helpmefindaname commented Sep 28, 2024

@WangXII thank you!

@YashotharaS can you try out if it works now? You might have to delete the %HOME%\.flair\models\hunflair2-ner folder first, so that you download the right version

@YashotharaS
Copy link
Author

Thanks a lot @WangXII and @helpmefindaname

I tried it, and it works fine now. Thanks again for your help :)

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