fix(deps): update machine-learning (#5180)

* fix(deps): update machine-learning

* updated ruff command

* use isinstance

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: mertalev <101130780+mertalev@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2023-12-25 22:37:48 -05:00
committed by GitHub
parent a7889e5e11
commit 3edc87f684
6 changed files with 65 additions and 65 deletions

View File

@@ -162,9 +162,9 @@ class OpenCLIPEncoder(BaseCLIPEncoder):
context_length = self.model_cfg["text_cfg"]["context_length"]
pad_token = self.tokenizer_cfg["pad_token"]
self.size = (
self.preprocess_cfg["size"][0] if type(self.preprocess_cfg["size"]) == list else self.preprocess_cfg["size"]
)
size = self.preprocess_cfg["size"]
self.size = size[0] if isinstance(size, list) else size
self.resampling = get_pil_resampling(self.preprocess_cfg["interpolation"])
self.mean = np.array(self.preprocess_cfg["mean"], dtype=np.float32)
self.std = np.array(self.preprocess_cfg["std"], dtype=np.float32)