Spaces:
Sleeping
Sleeping
Download Modules/utils.py from YousryEssam/StyleTTS2-Public-API-2: direct link, hf CLI and curl.
- Browser
- Download file 381 Bytes
-
https://huggingface.co/spaces/YousryEssam/StyleTTS2-Public-API-2/resolve/main/Modules/utils.py
- Command line
-
hf download hf://spaces/YousryEssam/StyleTTS2-Public-API-2/Modules/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/YousryEssam/StyleTTS2-Public-API-2/resolve/main/Modules/utils.py
381 Bytes
| def init_weights(m, mean=0.0, std=0.01): | |
| classname = m.__class__.__name__ | |
| if classname.find("Conv") != -1: | |
| m.weight.data.normal_(mean, std) | |
| def apply_weight_norm(m): | |
| classname = m.__class__.__name__ | |
| if classname.find("Conv") != -1: | |
| weight_norm(m) | |
| def get_padding(kernel_size, dilation=1): | |
| return int((kernel_size * dilation - dilation) / 2) | |