Download recipe/scripts/train_texture_low.py from gowombat/tiny-voca-da: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/gowombat/tiny-voca-da/resolve/main/recipe/scripts/train_texture_low.py
- Command line
-
hf download hf://gowombat/tiny-voca-da/recipe/scripts/train_texture_low.py
-
curl -L -o train_texture_low.py https://huggingface.co/gowombat/tiny-voca-da/resolve/main/recipe/scripts/train_texture_low.py
1.13 kB
| """tiny_voca.train with the texture loss starting at TEXTURE_LOW_HZ instead of the built-in 2 kHz. | |
| The texture loss (``--texture W``) matches the amount of frame-to-frame change of the Vocos log-mel | |
| per band and utterance. Upstream hard-codes its bands to centres >= 2 kHz | |
| (TrainingSystem.texture_bands, low_hz=2000). Night of 2026-11-25: with it, vowel motion reached | |
| -3% / -6% of the real speaker at 2-4 / 4-8 kHz, but 1-2 kHz stayed 10% short. This wrapper moves | |
| the start of the band without rebuilding the image. All arguments go to tiny_voca.train unchanged: | |
| TEXTURE_LOW_HZ=1000 python scripts/train_texture_low.py --texture 20 ... | |
| """ | |
| import os | |
| import sys | |
| from tiny_voca import train | |
| LOW_HZ = float(os.environ.get('TEXTURE_LOW_HZ', '2000')) | |
| _original = train.TrainingSystem.texture_bands.__func__ | |
| def _texture_bands(cls, bands, device, low_hz=2000.0): | |
| return _original(cls, bands, device, LOW_HZ) | |
| train.TrainingSystem.texture_bands = classmethod(_texture_bands) | |
| if __name__ == '__main__': | |
| print(f'texture loss bands from {LOW_HZ:.0f} Hz', flush=True) | |
| sys.argv[0] = 'tiny_voca.train' | |
| train.main() | |