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

[ner-tagger/geoTagger] Erreur: le service renvoie les données telles quelles #156

Closed
parmentf opened this issue Aug 7, 2024 · 1 comment · Fixed by #159
Closed

[ner-tagger/geoTagger] Erreur: le service renvoie les données telles quelles #156

parmentf opened this issue Aug 7, 2024 · 1 comment · Fixed by #159
Assignees
Labels
bug Something isn't working

Comments

@parmentf
Copy link
Contributor

parmentf commented Aug 7, 2024

Les tests de ner-tagger sont cassés au moins depuis le 25 juillet 2024.

Le test de geoTagger renvoie toujours les données d'entrée.
C'est en général parce que le programme python plante.

Le log du serveur semble confirmer cette hypothèse puisqu'il contient:

/usr/local/lib/python3.9/site-packages/huggingface_hub/file_download.py:671: FutureWarning: 'cached_download' is the legacy way to download files from the HF hub, please consider upgrading to 'hf_hub_download'
  warnings.warn(
2024-08-07 07:27:58,417 loading file /usr/sbin/.flair/models/ner-english/4f4cdab26f24cb98b732b389e6cebc646c36f54cfd6e0b7d3b90b25656e4262f.4ceda16ecbe95457bf3ad04aca9796ca5935d08e9b8e5bda872b5aaf0e0561c2
Traceback (most recent call last):
  File "/app/public/./v1/geoTagger/geoTagger.py", line 12, in <module>
    tagger = SequenceTagger.load("flair/ner-english")
  File "/usr/local/lib/python3.9/site-packages/flair/nn/model.py", line 135, in load
    model = cls._init_model_with_state_dict(state)
  File "/usr/local/lib/python3.9/site-packages/flair/models/sequence_tagger_model.py", line 271, in _init_model_with_state_dict
    model = SequenceTagger(
  File "/usr/local/lib/python3.9/site-packages/flair/models/sequence_tagger_model.py", line 160, in __init__
    embedding_dim: int = self.embeddings.embedding_length
AttributeError: 'dict' object has no attribute 'embedding_length'

Il est possible qu'une des dépendances (de quel paquet?) soit monté en version, et que du coup le modèle chargé soit devenu incompatible...

@parmentf parmentf added the bug Something isn't working label Aug 7, 2024
@parmentf parmentf changed the title [ner-tagger/geoTagger] Erreur des tests [ner-tagger/geoTagger] Erreur: le service renvoie les données telles quelles Aug 7, 2024
@parmentf
Copy link
Contributor Author

parmentf commented Aug 7, 2024

Le code télécharge la dernière version du modèle, qui n'est plus compatible avec la version de flair qu'on utilise.
En téléchargeant à la main le modèle dans la version voulue, on pourra spécifier le chemin local du modèle au lieu de le laisser télécharger au premier démarrage du container.

parmentf added a commit that referenced this issue Aug 7, 2024
Use a version of the model compatible with the version of flair used

Fix #156
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