Skip to content

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