Skip to main content

Module with search monotonic alignment algorithm

Project description

BigCodec

Python library for bigcodec. This is something that the author of bigcodec didn't do, so I'm doing it for him.

Setup

pip install bigcodec

Usage

import torch.accelerator
from bigcodec import BigCodec
import torchaudio

codec = BigCodec.from_pretrained("intexcp/bigcodec")

wav = torchaudio.load("enc.wav")[0]
wav = wav.unsqueeze(0)
device = torch.accelerator.current_accelerator().type if torch.accelerator.is_available() else "cpu"
codec = codec.to(device)
wav = wav.to(device)
with torch.no_grad():
    enc = codec.encode(wav)
    dec = codec.decode(enc)
print(enc)
torchaudio.save("dec.wav", dec.squeeze(0).cpu(), 16000, encoding="PCM_F")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bigcodec-0.0.2.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bigcodec-0.0.2-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file bigcodec-0.0.2.tar.gz.

File metadata

  • Download URL: bigcodec-0.0.2.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for bigcodec-0.0.2.tar.gz
Algorithm Hash digest
SHA256 42c227893aed371b27342d9493b474e4ad665af46d56a5e8c97138d301c0d41a
MD5 be00e09378a61b011b34e0ba96051cd3
BLAKE2b-256 87799f77ac0f347a34120f21b9a636e49402e9fea286f011fe21bbf286b1095b

See more details on using hashes here.

File details

Details for the file bigcodec-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: bigcodec-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for bigcodec-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5abacbb25c8e619b8d550d630a21a2f6ca84877c43c5664ad0498990ea197975
MD5 267f7d1d396bb28a0992996f4a7fa623
BLAKE2b-256 ebae788010e841840f4fd34b87280ca92cd70120ebd6a0f5a99a5abd417a5c17

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page