Skip to content

Commit 204fb30

Browse files
committed
Update to work as package
1 parent 7e02a48 commit 204fb30

33 files changed

+31
-13
lines changed

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The model is trained with utterances normalized to -20 LUFS. The `encode` functi
7373

7474
## Finetune
7575

76-
To finetune a model given its config and checkpoint, execute `train.py` file. You can also directly use `stable-audio-tools`:
76+
To finetune a model given its config and checkpoint, execute `train.py` file:
7777

7878
```bash
7979
python train.py \

Diff for: pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools","wheel"]
3+
build-backend = "setuptools.build_meta"

Diff for: requirements.txt

-7
This file was deleted.

Diff for: setup.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from setuptools import setup, find_packages
2+
3+
setup(
4+
name='stable-codec',
5+
version='0.1.0',
6+
author='Stability AI',
7+
author_email='[email protected]',
8+
description='Stable Codec: A series of codec models for speech and audio',
9+
long_description=open('README.md').read(),
10+
long_description_content_type='text/markdown',
11+
url='https://github.com/Stability-AI/stable-codec/',
12+
packages=find_packages(),
13+
python_requires='>=3.10',
14+
install_requires=['packaging',
15+
'wheel',
16+
'torch==2.4',
17+
'torchaudio==2.4',
18+
'stable-audio-tools==0.0.17',
19+
'pytorch-lightning==2.1',
20+
'prefigure==0.0.9']
21+
)

Diff for: stable_codec/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from stable_codec.model import StableCodec

Diff for: ctc_loss.py renamed to stable_codec/ctc_loss.py

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: model.py renamed to stable_codec/model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from stable_audio_tools.training.utils import copy_state_dict
1212
from stable_audio_tools.data.utils import VolumeNorm
1313

14-
from residual_fsq import ResidualFSQBottleneck
14+
from .residual_fsq import ResidualFSQBottleneck
1515
from stable_audio_tools import get_pretrained_model
1616

1717
class StableCodec(nn.Module):
File renamed without changes.
File renamed without changes.

Diff for: training_module.py renamed to stable_codec/training_module.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
create_optimizer_from_config, create_scheduler_from_config, log_metric,
2828
)
2929

30-
from ctc_loss import CTCLossModule, PERModule
30+
from .ctc_loss import CTCLossModule, PERModule
3131

3232
def trim_to_shortest(a, b):
3333
"""Trim the longer of two tensors to the length of the shorter one."""

Diff for: train.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from stable_audio_tools.models.utils import load_ckpt_state_dict, remove_weight_norm_from_model
1010
from stable_audio_tools.training.utils import copy_state_dict
1111

12-
from training_module import create_training_wrapper_from_config
13-
from training_demo import create_demo_callback_from_config
14-
from data.dataset import create_dataloader_from_config
12+
from stable_codec.training_module import create_training_wrapper_from_config
13+
from stable_codec.training_demo import create_demo_callback_from_config
14+
from stable_codec.data.dataset import create_dataloader_from_config
1515

1616
class ExceptionCallback(pl.Callback):
1717
def on_exception(self, trainer, module, err):

0 commit comments

Comments
 (0)