Spaces:
Paused
Paused
Download preprocess/tools/note_transcription/utils/text/encoding.py from aiqtech/SoulX-Singer: direct link, hf CLI and curl.
- Browser
- Download file 207 Bytes
-
https://huggingface.co/spaces/aiqtech/SoulX-Singer/resolve/main/preprocess/tools/note_transcription/utils/text/encoding.py
- Command line
-
hf download hf://spaces/aiqtech/SoulX-Singer/preprocess/tools/note_transcription/utils/text/encoding.py
-
curl -L -o encoding.py https://huggingface.co/spaces/aiqtech/SoulX-Singer/resolve/main/preprocess/tools/note_transcription/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 | |