Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
AIGC-Audio
/
AudioGPT
like
288
Build error
App
Files
Files
Community
8
Fetching metadata from the HF Docker repository...
8b71df5
AudioGPT
/
text_to_speech
/
utils
/
text
/
encoding.py
lmzjms
Upload 591 files
9206300
almost 2 years ago
raw
Copy download link
history
blame
Safe
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