From bbb681ae1b7d19fad93b7bfd28acb1f0891496bc Mon Sep 17 00:00:00 2001 From: Shaheer Ahmad <97315617+Shaheer66@users.noreply.github.com> Date: Mon, 26 Jan 2026 19:57:35 +0500 Subject: [PATCH 1/2] Modify CMD for CPU offloading in Dockerfile Updated CMD to include CPU offloading options. --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e146f9b..e9159ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,4 +22,6 @@ RUN mkdir -p /app/ssl EXPOSE 8998 ENTRYPOINT [] -CMD ["/app/moshi/.venv/bin/python", "-m", "moshi.server", "--ssl", "/app/ssl"] +#CMD ["/app/moshi/.venv/bin/python", "-m", "moshi.server", "--ssl", "/app/ssl"] +#use this for cpu offloading, for this you required to update the pyptoject.toml file as well +CMD ["/app/moshi/.venv/bin/python", "-m", "moshi.server", "--ssl", "/app/ssl", "--device", "cpu", "--cpu-offload"] From 205ac31e7d21c2cd1ecd3616f5b500e89741c340 Mon Sep 17 00:00:00 2001 From: Shaheer Ahmad <97315617+Shaheer66@users.noreply.github.com> Date: Mon, 26 Jan 2026 19:59:59 +0500 Subject: [PATCH 2/2] Add accelerate package dependency to pyproject.toml Added the package to avoid the below error raise ImportError( ImportError: CPU offloading requires the 'accelerate' package. Install it with: pip install accelerate --- moshi/pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moshi/pyproject.toml b/moshi/pyproject.toml index ead71e9..537fe8f 100644 --- a/moshi/pyproject.toml +++ b/moshi/pyproject.toml @@ -12,6 +12,7 @@ dependencies = [ "sphn >= 0.1.4, < 0.2", "torch >= 2.2.0, < 2.5", "aiohttp>=3.10.5, <3.11", + "accelerate==0.30.1", ] authors = [{name="Rajarshi Roy", email="rajarshir@nvidia.com"}] maintainers = [{name="Rajarshi Roy", email="rajarshir@nvidia.com"}] @@ -28,4 +29,4 @@ version = {attr = "moshi.__version__"} [build-system] requires = ["setuptools"] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta"