Spaces:
Build error
Build error
Download utils/text/encoding.py from yerfor/SyntaSpeech: direct link, hf CLI and curl.
- Browser
- Download file 207 Bytes
-
https://huggingface.co/spaces/yerfor/SyntaSpeech/resolve/main/utils/text/encoding.py
- Command line
-
hf download hf://spaces/yerfor/SyntaSpeech/utils/text/encoding.py
-
curl -L -o encoding.py https://huggingface.co/spaces/yerfor/SyntaSpeech/resolve/main/utils/text/encoding.py
207 Bytes
| import chardet | |
| def get_encoding(file): | |
| with open(file, 'rb') as f: | |
| encoding = chardet.detect(f.read())['encoding'] | |
| if encoding == 'GB2312': | |
| encoding = 'GB18030' | |
| return encoding | |