Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installable package #11

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Installable package #11

wants to merge 3 commits into from

Conversation

Tomiinek
Copy link

@Tomiinek Tomiinek commented Sep 4, 2024

Hello,

First of all, thank you so much for your excellent work! ❤️

I’m interested in using your models in my projects, and I find it more convenient when things are easily installable and can be imported as Python packages. To make this possible, I made some adjustments to your repository. Now, with a simple command:

pip install git+https://github.com/Tomiinek/WavTokenizer

or from a working directory

pip install -e .

I can use your repository as a package:

import torch
from wavtokenizer import WavTokenizer, convert_audio


wavtokenizer = WavTokenizer.from_pretrained0802(...)

wav = torch.randn(1, 24000)
wav = convert_audio(audio, 24000, 24000, 1) 
bandwidth_id = torch.tensor([0])
with torch.no_grad():
    features, codes = wavtokenizer.encode_infer(wav, bandwidth_id=bandwidth_id)
    audio_out = wavtokenizer.decode(features, bandwidth_id=bandwidth_id) 

I hope you find these changes useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant