Add is_prebuilt method in base huggingface class
@@ -58,6 +58,14 @@ class HuggingFaceDictionaryAgent(DictionaryAgent, ABC):
self.opt.get('text_truncate') or self.hf_tokenizer.model_max_length
)
+ def is_prebuilt(self):
+ """
+ Indicates whether the dictionary is fixed, and does not require building.
+
+ Overrides DictionaryAgent.is_prebuilt
+ """
+ return True
+
@abstractmethod
def get_tokenizer(self, opt):
"""
@@ -116,12 +124,6 @@ class HuggingFaceDictionaryAgent(DictionaryAgent, ABC):
class Gpt2DictionaryAgent(HuggingFaceDictionaryAgent):
- def is_prebuilt(self):
- """
- Indicates whether the dictionary is fixed, and does not require building.
- """
- return True
-
@property
def add_special_tokens(self) -> bool:
"""
