JarodMica / audiobook_maker

GNU General Public License v3.0
222 stars 39 forks source link

JSON Parse issue #53

Open freeload101 opened 3 days ago

freeload101 commented 3 days ago

I fed it a book with JSON it in ! I'm so cruel ! I just fixed it myself but thought you would want this:

Orig text {collection_type="snmp", device="ceos-01", host="telegraf-01", instance="telegraf-01:9004", intf_role="mgmt", job="telegraf", name="Management0", site="lab-site-01"} 800

Error


[1/1] Generating line: {collection_type="snmp", device="ceos-01", host="telegraf-01", instance="telegraf-01:9004", intf_role="mgmt", job="telegraf", name="Management0", site="lab-site-01"} 800
Traceback (most recent call last):
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\src\utils.py", line 1226, in generate_tortoise
    override = json.loads(match[0])
               ^^^^^^^^^^^^^^^^^^^^
  File "json\__init__.py", line 346, in loads
  File "json\decoder.py", line 337, in decode
  File "json\decoder.py", line 353, in raw_decode
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\runtime\Lib\site-packages\gradio\queueing.py", line 501, in call_prediction
    output = await route_utils.call_process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\runtime\Lib\site-packages\gradio\route_utils.py", line 258, in call_process_api
    output = await app.get_blocks().process_api(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\runtime\Lib\site-packages\gradio\blocks.py", line 1710, in process_api
    result = await self.call_function(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\runtime\Lib\site-packages\gradio\blocks.py", line 1250, in call_function
    prediction = await anyio.to_thread.run_sync(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\runtime\Lib\site-packages\anyio\to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\runtime\Lib\site-packages\anyio\_backends\_asyncio.py", line 2144, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\runtime\Lib\site-packages\anyio\_backends\_asyncio.py", line 851, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\runtime\Lib\site-packages\gradio\utils.py", line 693, in wrapper
    response = f(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\runtime\Lib\site-packages\gradio\utils.py", line 693, in wrapper
    response = f(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\src\webui.py", line 134, in generate_proxy
    raise e
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\src\webui.py", line 128, in generate_proxy
    sample, outputs, stats = generate(**kwargs)
                             ^^^^^^^^^^^^^^^^^^
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\src\utils.py", line 366, in generate
    return generate_tortoise(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\backup\VOICE_CLONE\ai-voice-cloning-3.0\src\utils.py", line 1229, in generate_tortoise
    raise Exception("Prompt settings editing requested, but received invalid JSON")
Exception: Prompt settings editing requested, but received invalid JSON

Your JSON file


    "4516": {
        "sentence": "{collection_type=\"snmp\", device=\"ceos-01\", host=\"telegraf-01\", instance=\"telegraf-01:9004\", intf_role=\"mgmt\", job=\"telegraf\", name=\"Management0\", site=\"lab-site-01\"} 800",
        "audio_path": "",
        "generated": false
    },
freeload101 commented 3 days ago

It also does not like


"sentence": "."

OR 

"sentence": ""

this would never happen but I tried to just skip that line by saying nothing and it really does not like nothing so I used "blah"