Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
WORKDIR /app/moshi/

COPY moshi/ /app/moshi/
RUN uv venv /app/moshi/.venv --python 3.12
RUN uv sync

RUN mkdir -p /app/ssl
Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ PersonaPlex is a real-time, full-duplex speech-to-speech conversational model th

### Prerequisites

Install the [Opus audio codec](https://github.com/xiph/opus) development library:
1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/)

2. Install the [Opus audio codec](https://github.com/xiph/opus) development library:

```bash
# Ubuntu/Debian
sudo apt install libopus-dev
Expand All @@ -33,12 +36,13 @@ brew install opus

Download this repository and install with:
```bash
pip install moshi/.
cd moshi
uv sync
```

Extra step for Blackwell based GPUs as suggested in (See https://github.com/NVIDIA/personaplex/issues/2):
```bash
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu130
uv sync --extra cu130
```


Expand All @@ -53,12 +57,12 @@ export HF_TOKEN=<YOUR_HUGGINGFACE_TOKEN>

Launch server for live interaction (temporary SSL certs for https):
```bash
SSL_DIR=$(mktemp -d); python -m moshi.server --ssl "$SSL_DIR"
SSL_DIR=$(mktemp -d); uv run moshi-server --ssl "$SSL_DIR"
```

**CPU Offload:** If your GPU has insufficient memory, use the `--cpu-offload` flag to offload model layers to CPU. This requires the `accelerate` package (`pip install accelerate`):
```bash
SSL_DIR=$(mktemp -d); python -m moshi.server --ssl "$SSL_DIR" --cpu-offload
SSL_DIR=$(mktemp -d); uv run moshi-server --ssl "$SSL_DIR" --cpu-offload
```

Access the Web UI from a browser at `localhost:8998` if running locally, otherwise look for the access link printed by the script:
Expand All @@ -75,7 +79,7 @@ Add `--cpu-offload` to any command below if your GPU has insufficient memory (re
**Assistant example:**
```bash
HF_TOKEN=<TOKEN> \
python -m moshi.offline \
uv run moshi-offline \
--voice-prompt "NATF2.pt" \
--input-wav "assets/test/input_assistant.wav" \
--seed 42424242 \
Expand All @@ -86,7 +90,7 @@ python -m moshi.offline \
**Service example:**
```bash
HF_TOKEN=<TOKEN> \
python -m moshi.offline \
uv run moshi-offline \
--voice-prompt "NATM1.pt" \
--text-prompt "$(cat assets/test/prompt_service.txt)" \
--input-wav "assets/test/input_service.wav" \
Expand Down
1 change: 1 addition & 0 deletions moshi/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
3 changes: 3 additions & 0 deletions moshi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# moshi-personaplex

Local install for moshi-personaplex.
43 changes: 31 additions & 12 deletions moshi/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[project]
name = "moshi-personaplex"
requires-python = ">= 3.10"
version = "0.1.0"
description = "Personaplex finetune of moshi to enable role and voice control."
readme = "README.md"
authors = [{name = "Rajarshi Roy", email = "rajarshir@nvidia.com"}]
maintainers = [{name = "Rajarshi Roy", email = "rajarshir@nvidia.com"}]
license = {text = "MIT"}
requires-python = ">= 3.10"
dependencies = [
"numpy >= 1.26, < 2.2",
"safetensors >= 0.4.0, < 0.5",
Expand All @@ -10,22 +15,36 @@ dependencies = [
"sentencepiece == 0.2",
"sounddevice == 0.5",
"sphn >= 0.1.4, < 0.2",
"torch >= 2.2.0, < 2.5",
"torch >= 2.2.0",
"aiohttp>=3.10.5, <3.11",
]
authors = [{name="Rajarshi Roy", email="rajarshir@nvidia.com"}]
maintainers = [{name="Rajarshi Roy", email="rajarshir@nvidia.com"}]
license = {text = "MIT"}
dynamic = ["version"]
readme = "README.md"

[build-system]
requires = ["uv_build>=0.9.13,<0.10.0"]
build-backend = "uv_build"

[tool.uv.build-backend]
module-name = "moshi"
module-root = ""

[project.scripts]
moshi-server = "moshi.server:main"
moshi-offline = "moshi.offline:main"

[tool.setuptools.dynamic]
version = {attr = "moshi.__version__"}

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
# CUDA Config

[[tool.uv.index]]
name = "pytorch-cu130"
url = "https://download.pytorch.org/whl/cu130"
explicit = true

[tool.uv.sources]
torch = [
{ index = "pytorch-cu130", extra = "cu130" },
]

[project.optional-dependencies]
cu130 = [
"torch >= 2.2.0",
]
9 changes: 0 additions & 9 deletions moshi/requirements.txt

This file was deleted.

10 changes: 0 additions & 10 deletions moshi/setup.cfg

This file was deleted.

1,629 changes: 1,629 additions & 0 deletions moshi/uv.lock

Large diffs are not rendered by default.