erew123 / alltalk_tts

AllTalk is based on the Coqui TTS engine, similar to the Coqui_tts extension for Text generation webUI, however supports a variety of advanced features, such as a settings page, low VRAM support, DeepSpeed, narrator, model finetuning, custom models, wav file maintenance. It can also be used with 3rd Party software via JSON calls.
GNU Affero General Public License v3.0
1.09k stars 115 forks source link

Disable Coqui analytics / Cannot finetune offline #16

Closed TheLounger closed 10 months ago

TheLounger commented 10 months ago

Please generate a diagnostics report and upload the "diagnostics.log".

https://github.com/erew123/alltalk_tts/tree/main?#-how-to-make-a-diagnostics-report-file

Describe the bug Coqui trainer package uses tracking/analytics and cannot work offline.

To Reproduce

Screenshots N/A

Text/logs

Traceback (most recent call last):
  File "O:\ai\tests\alltalk\alltalk_tts\installer_files\env\Lib\site-packages\requests\adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "O:\ai\tests\alltalk\alltalk_tts\installer_files\env\Lib\site-packages\urllib3\connectionpool.py", line 844, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "O:\ai\tests\alltalk\alltalk_tts\installer_files\env\Lib\site-packages\urllib3\util\retry.py", line 515, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='coqui.gateway.scarf.sh', port=443): Max retries exceeded with url: /trainer/training_run (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000029092034490>: Failed to establish a new connection: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "O:\ai\tests\alltalk\alltalk_tts\finetune.py", line 817, in train_model
    config_path, original_xtts_checkpoint, vocab_file, exp_path, speaker_wav = train_gpt(language, num_epochs, batch_size, grad_acumm, train_csv, eval_csv, output_path=str(output_path), max_audio_length=max_audio_length)
                                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "O:\ai\tests\alltalk\alltalk_tts\finetune.py", line 394, in train_gpt
    trainer = Trainer(
              ^^^^^^^^
  File "O:\ai\tests\alltalk\alltalk_tts\installer_files\env\Lib\site-packages\trainer\trainer.py", line 583, in __init__
    ping_training_run()
  File "O:\ai\tests\alltalk\alltalk_tts\installer_files\env\Lib\site-packages\trainer\analytics.py", line 12, in ping_training_run
    _ = requests.get(URL, timeout=5)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "O:\ai\tests\alltalk\alltalk_tts\installer_files\env\Lib\site-packages\requests\api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "O:\ai\tests\alltalk\alltalk_tts\installer_files\env\Lib\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "O:\ai\tests\alltalk\alltalk_tts\installer_files\env\Lib\site-packages\requests\sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "O:\ai\tests\alltalk\alltalk_tts\installer_files\env\Lib\site-packages\requests\sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "O:\ai\tests\alltalk\alltalk_tts\installer_files\env\Lib\site-packages\requests\adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='coqui.gateway.scarf.sh', port=443): Max retries exceeded with url: /trainer/training_run (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000029092034490>: Failed to establish a new connection: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions'))

Desktop (please complete the following information): AllTalk was updated: 2023-12-24 da0445489e77a077ddfcac2da744065dfb2c3985 Custom Python environment: Yes, Miniconda environment made with Oobabooga start_windows.bat, Python 3.11. Text-generation-webUI was updated: N/A

Additional context It's possible to start the training by commenting out this line but there probably is a better/cleaner way to get rid of their shenanigans.

erew123 commented 10 months ago

Please set the following environment variable for whatever OS you are on TRAINER_TELEMETRY=0

https://github.com/coqui-ai/Trainer#anonymized-telemetry

TheLounger commented 10 months ago

Ah, thanks! Maybe put that in your script?

erew123 commented 10 months ago

Should be able to do that, but Ill need to test that pushing the environment variable works across Win/Linux/Mac without any complaints. Ill look into it.

Have a good Christmas! :)

TheLounger commented 10 months ago

This should work:

os.environ['TRAINER_TELEMETRY'] = '0'

Currently in a training session so can't test anything, but that's how Oobabooga does it.

erew123 commented 10 months ago

Yeah Id spotted that one. Given it a few checks and updated as it should be fine. Otherwise. Hope you're enjoying it/finding it generally works well! Have a good Christmas! (or however you celebrate the holidays)