From 170860b0839e6a262a6d85eaaab91670c6541b98 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Wed, 9 Oct 2024 13:46:29 -0500 Subject: [PATCH] use cache paths --- frigate/embeddings/functions/onnx.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frigate/embeddings/functions/onnx.py b/frigate/embeddings/functions/onnx.py index 3b2d8724d..abdac7aef 100644 --- a/frigate/embeddings/functions/onnx.py +++ b/frigate/embeddings/functions/onnx.py @@ -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):