You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Translation stopped working for me and I'm not sure what changed.
fromtxtai.pipelineimportTranslation# Create and run pipelinetranslate=Translation()
translate("This is a test translation into Spanish", "es")
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[17], line 4
1 from txtai.pipeline import Translation
3 # Create and run pipeline
----> 4 translate = Translation()
5 translate("This is a test translation into Spanish", "es")
File ~/Development/notebooks/.venv/lib/python3.10/site-packages/txtai/pipeline/text/translation.py:54, in Translation.__init__(self, path, quantize, gpu, batch, langdetect, findmodels)
52 # Language models
53 self.models = {}
---> 54 self.ids = self.modelids()
File ~/Development/notebooks/.venv/lib/python3.10/site-packages/txtai/pipeline/text/translation.py:115, in Translation.modelids(self)
107 def modelids(self):
108 """
109 Runs a query to get a list of available language models from the Hugging Face API.
110
111 Returns:
112 list of source-target language model ids
113 """
--> 115 ids = [x.modelId for x in HfApi().list_models(author="Helsinki-NLP")] if self.findmodels else []
116 return set(ids)
File ~/Development/notebooks/.venv/lib/python3.10/site-packages/txtai/pipeline/text/translation.py:115, in <listcomp>(.0)
107 def modelids(self):
108 """
109 Runs a query to get a list of available language models from the Hugging Face API.
110
111 Returns:
112 list of source-target language model ids
113 """
--> 115 ids = [x.modelId for x in HfApi().list_models(author="Helsinki-NLP")] if self.findmodels else []
116 return set(ids)
AttributeError: 'ModelInfo' object has no attribute 'modelId'
Translation stopped working for me and I'm not sure what changed.
It looks like the last version of huggingface-hub that used
modelId
was v0.18It isn't available in v0.19 or later
The text was updated successfully, but these errors were encountered: