Python library for bigcodec.
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
Release history Release notifications | RSS feed
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.3.tar.gz
(8.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bigcodec-0.0.3.tar.gz.
File metadata
- Download URL: bigcodec-0.0.3.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21a871937b8036522dfa550bd5937bd0e658869d4c4f76bf4312160ab15a0a75
|
|
| MD5 |
4efb2cb4e7b59d2d51f8fc474ea31b5a
|
|
| BLAKE2b-256 |
87ee10863bc3fe57027ca6e5c929de3e4a3e5c1d70127b1d77040c47d83d5a79
|
File details
Details for the file bigcodec-0.0.3-py3-none-any.whl.
File metadata
- Download URL: bigcodec-0.0.3-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a18fa586ed01fc9fabcfb8311667778ae8e7959880e9dd583e8d782127fb69a6
|
|
| MD5 |
7018a6eade28f8d0544dfd6334ed7ef9
|
|
| BLAKE2b-256 |
9480569c677c7402eebaf6b84099049fc3ba5e09cd4944d40166993ccbc96bd3
|