Skip to content

Commit

Permalink
fix(deps): update machine-learning (#5180)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
renovate[bot] and mertalev authored Dec 26, 2023
1 parent a7889e5 commit 3edc87f
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ jobs:
poetry install --with dev
- name: Lint with ruff
run: |
poetry run ruff check --format=github app export
poetry run ruff check --output-format=github app export
- name: Check black formatting
run: |
poetry run black --check app export
Expand Down
4 changes: 2 additions & 2 deletions machine-learning/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-bookworm@sha256:ba7a7ac30c38e119c4304f98ef0e188f90f4f67a958bb6899da9defb99bfb471 as builder
FROM python:3.11-bookworm@sha256:291405e32318285d8913b7b03293777c255fb1e89305c82aa495ac747b0049fe as builder

ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
Expand All @@ -13,7 +13,7 @@ ENV VIRTUAL_ENV="/opt/venv" PATH="/opt/venv/bin:${PATH}"
COPY poetry.lock pyproject.toml ./
RUN poetry install --sync --no-interaction --no-ansi --no-root --only main

FROM python:3.11-slim-bookworm@sha256:cfd7ed5c11a88ce533d69a1da2fd932d647f9eb6791c5b4ddce081aedf7f7876
FROM python:3.11-slim-bookworm@sha256:8f64a67710f3d981cf3008d6f9f1dbe61accd7927f165f4e37ea3f8b883ccc3f

RUN apt-get update && apt-get install -y --no-install-recommends tini libmimalloc2.0 && rm -rf /var/lib/apt/lists/*

Expand Down
6 changes: 3 additions & 3 deletions machine-learning/app/models/clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ def _load(self) -> None:
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)
Expand Down
2 changes: 1 addition & 1 deletion machine-learning/app/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ class Face(TypedDict):


def has_profiling(obj: Any) -> TypeGuard[HasProfiling]:
return hasattr(obj, "profiling") and type(obj.profiling) == dict
return hasattr(obj, "profiling") and isinstance(obj.profiling, dict)
2 changes: 1 addition & 1 deletion machine-learning/export/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mambaorg/micromamba:bookworm-slim@sha256:5ea70d22075f7209d0410e28b7ce5b1703623099fa04d1154081156b180f739c as builder
FROM mambaorg/micromamba:bookworm-slim@sha256:a7033851ca71454ed8cfbc958fdd62a72e6fa90f71ccb3aa9b15e67a98f66a1e as builder

ENV NODE_ENV=production \
TRANSFORMERS_CACHE=/cache \
Expand Down
114 changes: 57 additions & 57 deletions machine-learning/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3edc87f

Please sign in to comment.