Closed darkzbaron closed 1 year ago
Getting similar error whenever I try to use the library.
/home/wenniu/anaconda3/envs/tts/lib/python3.9/site-packages/TTS/.models.json
This json file format has an extra comma, cause ttf --list_models
to be wrong:
tts --list_models ─╯
Traceback (most recent call last):
File "/home/wenniu/anaconda3/envs/tts/bin/tts", line 8, in <module>
sys.exit(main())
File "/home/wenniu/anaconda3/envs/tts/lib/python3.9/site-packages/TTS/bin/synthesize.py", line 375, in main
manager = ModelManager(path, progress_bar=args.progress_bar)
File "/home/wenniu/anaconda3/envs/tts/lib/python3.9/site-packages/TTS/utils/manage.py", line 55, in __init__
self.read_models_file(models_file)
File "/home/wenniu/anaconda3/envs/tts/lib/python3.9/site-packages/TTS/utils/manage.py", line 68, in read_models_file
self.models_dict = json.load(json_file)
File "/home/wenniu/anaconda3/envs/tts/lib/python3.9/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/home/wenniu/anaconda3/envs/tts/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/home/wenniu/anaconda3/envs/tts/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/wenniu/anaconda3/envs/tts/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 11 column 21 (char 549)
"tts_models": {
"multilingual": {
"multi-dataset": {
"xtts_v1": {
"description": "XTTS-v1 by Coqui with 13 languages and cross-language voice cloning.",
"hf_url": [
"https://coqui.gateway.scarf.sh/hf-coqui/XTTS-v1/hifigan/model.pth",
"https://coqui.gateway.scarf.sh/hf-coqui/XTTS-v1/hifigan/config.json",
"https://coqui.gateway.scarf.sh/hf-coqui/XTTS-v1/hifigan/vocab.json", <==========there is an extra comma, should delete it. (line 10)
],
"default_vocoder": null,
"commit": "e5140314",
"license": "CPML",
"contact": "info@coqui.ai",
"tos_required": true
},
delete comma at the end of line 11.
The fix took some time to be deployed on Pypi , can you please try now with pip install -U TTS
?
@erogol ,
Looks like the fix didn't deploy to Pypi... I just installed TTS with pip install TTS and after reading the bug also ran pip install -U TTS
I am getting this same error when following the instructions on the README TTS(cs_api_model="XTTS").list_models()
also if coqui_studio model is loaded, the tts_to_file won't work at all and I get the JSONDecodeError tts = TTS(model_name="coqui_studio/en/Torcull Diarmuid/coqui_studio", progress_bar=False)
Thanks for the push @erogol !
print(TTS().list_models())
was not working in any case, now it just does not work when trying to list models from Coqui studio. Essentially this does not work:
models = TTS(cs_api_model="XTTS").list_models()
it returns
Expecting value: line 1 column 1 (char 0)
When I am trying to generate audio with
tts.tts_to_file(text="This is a test.", file_path=OUTPUT_PATH)
I get
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Thanks so much!
Same here. Can't follow the guide in the readme because of this error.
data = res.read()
in
def list_voices(self):
"""List custom voices created by the user."""
conn = http.client.HTTPSConnection("app.coqui.ai")
url = self.MODEL_ENDPOINTS[self.model]["list_voices"]
conn.request("GET", f"{url}", headers=self.headers)
res = conn.getresponse()
data = res.read()
return [Speaker(s, True) for s in json.loads(data)["result"]]
results in HTML encoded as btyes, NOT json.
Running into the same error, any workarounds?
Also having this problem with the sample code from the readme. I can list the models but tts.tts_to_file(text="This is a test.", file_path="./test.wav")
gives me the error json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
.
@erogol any idea why this got closed?
I think I've fixed this, please check out the PR for details on what's happening and how I fixed it https://github.com/coqui-ai/TTS/pull/3138
Describe the bug
Can't generate with Coqui Studio voices
To Reproduce
When running
tts = TTS(model_name="coqui_studio/en/Torcull Diarmuid/coqui_studio", progress_bar=False) tts.tts_to_file(text="This is a test.", file_path="out.wav")
I get that error json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Expected behavior
Voice generated
Logs
No response
Environment
Additional context
Also I find that voices generated with xTTS local are far from what is generated in Coqui Studio, any explanation to that?