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]: Loading some models on Windows causes PosixPath issues #3634

Closed
alanakbik opened this issue Mar 12, 2025 · 2 comments
Closed

[Bug]: Loading some models on Windows causes PosixPath issues #3634

alanakbik opened this issue Mar 12, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@alanakbik
Copy link
Collaborator

Describe the bug

Some serialized flair models currently cannot be loaded on Windows due to serialized PosixPaths. These models need to be identified and updated for Windows compatibility.

To Reproduce

from flair.data import Sentence
from flair.models import SequenceTagger

model = SequenceTagger.load("pos-multi")

sentence = Sentence("I love Berlin")

model.predict(sentence)

print(sentence)

Expected behavior

All models should run on Windows.

Logs and Stack traces


Screenshots

No response

Additional Context

No response

Environment

Versions:

Flair

0.15.1

Pytorch

2.5.1+cu124

Transformers

4.48.2

GPU

True

@alanakbik alanakbik added the bug Something isn't working label Mar 12, 2025
@alanakbik alanakbik self-assigned this Mar 13, 2025
@alanakbik
Copy link
Collaborator Author

Issue has been fixed by reserializing the models without the PosixPath.

In the course of fixing this issue, two other models were found to suffer from the same issue: 'ner-ukrainian' and 'pos-ukrainian'. Two PRs have been opened on HF to address this:

alanakbik added a commit that referenced this issue Mar 13, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Rename fetch_model parameter and add better code comments
@alanakbik
Copy link
Collaborator Author

Closed by #3637

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

No branches or pull requests

1 participant