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]: Error messages when loading standard models through Classifier #3503

Closed
alanakbik opened this issue Jul 21, 2024 · 0 comments · Fixed by #3504
Closed

[Bug]: Error messages when loading standard models through Classifier #3503

alanakbik opened this issue Jul 21, 2024 · 0 comments · Fixed by #3504
Labels
bug Something isn't working

Comments

@alanakbik
Copy link
Collaborator

Describe the bug

Loading one of the packaged models using Classifier.load() will cause error messages that a model is not found, even if it is found and loaded.

The problem has become visible through the addition of the PrefixedSequenceTagger class. The loading mechansim in Classifier cycles through all inheriting subclasses (TextClassifier, TokenClassifier, SequenceTagger, etc.), attempts to load the model and if it fails, moves on to the next class. However, some classes output their own error messages, so these are seen by the user.

To Reproduce

from flair.nn import Classifier

tagger = Classifier.load("ner")

Expected behavior

An error message should only be shown if no model can be loaded.

Logs and Stack traces

No response

Screenshots

No response

Additional Context

No response

Environment

Python 3.9,
current master branch

@alanakbik alanakbik added the bug Something isn't working label Jul 21, 2024
alanakbik added a commit that referenced this issue Jul 23, 2024
Move error message to main load function
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.

1 participant