Title: NameError: name 'torchtext' is not defined when using BowVAEInferencer
Description:
When trying to encode texts using BowVAEInferencer and saving/reloading the inferencer, the code throws a NameError related to torchtext. It seems that torchtext is used internally but is not imported or listed as a dependency.
Reproduction Steps:
from tmnt.inference import BowVAEInferencer
# Initialize inferencer
inferencer = BowVAEInferencer(estimator, pre_vectorizer=tf_vectorizer)
# Encode some texts
encodings = inferencer.encode_texts([
'Greater Armenia would stretch from Karabakh, to the Black Sea, to the Mediterranean, so if you use the term Greater Armenia use it with care.',
'I have two pairs of headphones I\'d like to sell. These are excellent, and both in great condition'
])
# Save the inferencer
inferencer.save(model_dir='_model_dir')
# Reload the inferencer
reloaded_inferencer = BowVAEInferencer.from_saved(model_dir='_model_dir')
Error Traceback:
NameError: name 'torchtext' is not defined
Environment:
- Python version: 3.10
- TMNT version:
0.7.62b20251015
Title:
NameError: name 'torchtext' is not definedwhen usingBowVAEInferencerDescription:
When trying to encode texts using
BowVAEInferencerand saving/reloading the inferencer, the code throws aNameErrorrelated totorchtext. It seems thattorchtextis used internally but is not imported or listed as a dependency.Reproduction Steps:
Error Traceback:
Environment:
0.7.62b20251015