use cache paths

This commit is contained in:
Josh Hawkins 2024-10-09 13:46:29 -05:00
parent c87bdb4d26
commit 170860b083

View File

@ -119,14 +119,16 @@ class GenericONNXEmbedding:
def _load_tokenizer(self):
tokenizer_path = os.path.join(f"{MODEL_CACHE_DIR}/{self.model_name}/tokenizer")
return AutoTokenizer.from_pretrained(
tokenizer_path, clean_up_tokenization_spaces=True
self.model_name, cache_dir=tokenizer_path, clean_up_tokenization_spaces=True
)
def _load_feature_extractor(self):
feature_extractor_path = os.path.join(
f"{MODEL_CACHE_DIR}/{self.model_name}/feature_extractor"
)
return AutoFeatureExtractor.from_pretrained(feature_extractor_path)
return AutoFeatureExtractor.from_pretrained(
self.model_name, cache_dir=feature_extractor_path
)
def _load_model(self, path: str, providers: List[str]):
if os.path.exists(path):