some changes

This commit is contained in:
Alexandre Défossez 2025-07-03 14:52:02 +02:00
parent b2416b19dd
commit 31f8746881

View File

@ -7,7 +7,10 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"!pip install \"moshi==0.2.7\"" "!pip install \"moshi==0.2.7\"\n",
"# If running from a Google Colab, you can instead use the following two lines to prevent PyTorch from being reinstalled.\n",
"# !pip install 'sphn < 0.2'# If\n",
"# !pip install --no-deps \"moshi==0.2.7"
] ]
}, },
{ {
@ -21,7 +24,6 @@
"import sys\n", "import sys\n",
"\n", "\n",
"import numpy as np\n", "import numpy as np\n",
"import sphn\n",
"import torch\n", "import torch\n",
"from moshi.models.loaders import CheckpointInfo\n", "from moshi.models.loaders import CheckpointInfo\n",
"from moshi.models.tts import DEFAULT_DSM_TTS_REPO, DEFAULT_DSM_TTS_VOICE_REPO, TTSModel\n", "from moshi.models.tts import DEFAULT_DSM_TTS_REPO, DEFAULT_DSM_TTS_VOICE_REPO, TTSModel\n",
@ -76,6 +78,7 @@
"print(\"Generating audio...\")\n", "print(\"Generating audio...\")\n",
"\n", "\n",
"pcms = []\n", "pcms = []\n",
"@torch.no_grad()\n",
"def _on_frame(frame):\n", "def _on_frame(frame):\n",
" print(\"Step\", len(pcms), end=\"\\r\")\n", " print(\"Step\", len(pcms), end=\"\\r\")\n",
" if (frame != -1).all():\n", " if (frame != -1).all():\n",