Download chatterbox/src/chatterbox/utils.py from AvatarResurrectionChatbot/Chatterbox: direct link, hf CLI and curl.
- Browser
- Download file 489 Bytes
-
https://huggingface.co/spaces/AvatarResurrectionChatbot/Chatterbox/resolve/main/chatterbox/src/chatterbox/utils.py
- Command line
-
hf download hf://spaces/AvatarResurrectionChatbot/Chatterbox/chatterbox/src/chatterbox/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/AvatarResurrectionChatbot/Chatterbox/resolve/main/chatterbox/src/chatterbox/utils.py
489 Bytes
| # import numpy as np | |
| # | |
| # | |
| # def trim_silence(wav, speech_timestamps, sr): | |
| # """TODO: fading""" | |
| # if len(speech_timestamps) == 0: | |
| # return wav # WARNING: no speech detected, returning original wav | |
| # segs = [] | |
| # for segment in speech_timestamps: | |
| # start_s, end_s = segment['start'], segment['end'] | |
| # start = int(start_s * sr) | |
| # end = int(end_s * sr) | |
| # seg = wav[start: end] | |
| # segs.append(seg) | |
| # return np.concatenate(segs) | |