Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye217 committed Oct 9, 2024
1 parent dd6b0c9 commit beae4b9
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions frigate/embeddings/functions/onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,27 +119,21 @@ def _load_model_and_tokenizer(self):
)

def _load_tokenizer(self):
if not self.tokenizer:
tokenizer_path = os.path.join(
f"{MODEL_CACHE_DIR}/{self.model_name}/tokenizer"
)
self.tokenizer = AutoTokenizer.from_pretrained(
self.model_name,
cache_dir=tokenizer_path,
trust_remote_code=True,
clean_up_tokenization_spaces=True,
)
tokenizer_path = os.path.join(f"{MODEL_CACHE_DIR}/{self.model_name}/tokenizer")
return AutoTokenizer.from_pretrained(
self.model_name,
cache_dir=tokenizer_path,
trust_remote_code=True,
clean_up_tokenization_spaces=True,
)

def _load_feature_extractor(self):
if not self.feature_extractor:
feature_extractor_path = os.path.join(
f"{MODEL_CACHE_DIR}/{self.model_name}/feature_extractor"
)
self.feature_extractor = AutoFeatureExtractor.from_pretrained(
self.model_name,
trust_remote_code=True,
cache_dir=feature_extractor_path,
)
feature_extractor_path = os.path.join(
f"{MODEL_CACHE_DIR}/{self.model_name}/feature_extractor"
)
return AutoFeatureExtractor.from_pretrained(
self.model_name, trust_remote_code=True, cache_dir=feature_extractor_path
)

def _load_model(self, path: str, providers: List[str]):
if os.path.exists(path):
Expand Down

0 comments on commit beae4b9

Please sign in to comment.