Skip to content

Commit

Permalink
Update notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
hubertsiuzdak committed Jun 12, 2023
1 parent d768198 commit 4220017
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions notebooks/Bark+Vocos.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"private_outputs": true,
"provenance": [],
"gpuType": "T4",
"authorship_tag": "ABX9TyNuxsqp/FTsmltYeYfMZ6sw",
"authorship_tag": "ABX9TyMC53IsYoVJIVijVzw3ADvX",
"include_colab_link": true
},
"kernelspec": {
Expand All @@ -26,7 +26,7 @@
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/charactr-platform/vocos/blob/bark/notebooks/Bark%2BVocos.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
"<a href=\"https://colab.research.google.com/github/charactr-platform/vocos/blob/main/notebooks/Bark%2BVocos.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
Expand All @@ -41,7 +41,7 @@
{
"cell_type": "markdown",
"source": [
"In this notebook, we use Bark generative model to turn a text prompt into EnCodec audio tokens. These tokens then go through two decoders, EnCodec and Vocos, to reconstruct the audio waveform. Compare the results to discover the differences in audio quality and characteristics."
"In this notebook, we use [Bark](https://github.com/suno-ai/bark) generative model to turn a text prompt into EnCodec audio tokens. These tokens then go through two decoders, EnCodec and Vocos, to reconstruct the audio waveform. Compare the results to discover the differences in audio quality and characteristics."
],
"metadata": {
"id": "zJFDte0daDAz"
Expand Down Expand Up @@ -103,6 +103,7 @@
"cell_type": "code",
"source": [
"from vocos import Vocos\n",
"import torch\n",
"\n",
"device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
"vocos = Vocos.from_pretrained(\"charactr/vocos-encodec-24khz\").to(device)"
Expand Down Expand Up @@ -225,8 +226,6 @@
{
"cell_type": "code",
"source": [
"import torch\n",
"\n",
"audio_tokens_torch = torch.from_numpy(audio_tokens).to(device)\n",
"features = vocos.codes_to_features(audio_tokens_torch)\n",
"vocos_output = vocos.decode(features, bandwidth_id=torch.tensor([2], device=device)) # 6 kbps\n",
Expand Down

0 comments on commit 4220017

Please sign in to comment.