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

[Bug]: New PyTorch version (2.6.0) breaks existing code #3607

Closed
pawelad opened this issue Jan 31, 2025 · 0 comments · Fixed by #3608
Closed

[Bug]: New PyTorch version (2.6.0) breaks existing code #3607

pawelad opened this issue Jan 31, 2025 · 0 comments · Fixed by #3608
Assignees
Labels
bug Something isn't working

Comments

@pawelad
Copy link

pawelad commented Jan 31, 2025

Describe the bug

After upgrading PyTorch to v2.6.0, our code started breaking with:

ValueError: Could not find any model with name 'ner-multi'

After downgrading to v2.5.1, everything works as expected.

To Reproduce

from flair.data import Sentence
from flair.nn import Classifier

value = "Acme Inc"

ner_tagger = Classifier.load("ner-multi")
sentence = Sentence(value)
ner_tagger.predict(sentence)

Expected behavior

Model is loaded without an error.

Logs and Stack traces

2025-01-31 12:21:28,416 --------------------------------------------------------------------------------
2025-01-31 12:21:28,417 ERROR: The key 'ner-multi' was neither found on the ModelHub nor is this a valid path to a file on your system!
2025-01-31 12:21:28,417  -> Please check https://huggingface.co/models?filter=flair for all available models.
2025-01-31 12:21:28,417  -> Alternatively, point to a model file on your local drive.
2025-01-31 12:21:28,417 --------------------------------------------------------------------------------

Screenshots

No response

Additional Context

No response

Environment

#### Versions:
##### Flair
0.15.0
##### Pytorch
2.6.0
##### Transformers
4.48.2
#### GPU
False
@pawelad pawelad added the bug Something isn't working label Jan 31, 2025
@helpmefindaname helpmefindaname self-assigned this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants