Silero TTS model loading fails with ValueError: not enough values to unpack
09:00 22 Feb 2024

This code for Silero TTS used to work before, but after creating a new folder and rewriting it, I get an error when loading the model.

Code:

import time, torch, speech_recognition as sr, sounddevice as sd, random

language = 'ru'
model_id = 'ru_v3'
sample_rate = 48000
speaker = 'baya'
put_ac = True
put_yoo = True
device = torch.device('cpu')

model, _ = torch.hub.load(repo_or_dir='snakers4_silero-    models_master',
                      model='silero_tts',
                      language=language,
                      speaker=model_id)
model.to(device)

# rest of the code...

Error:

File "c:\Users\USER\Desktop\fri\main.py", line 10, in 
model, _ = torch.hub.load(repo_or_dir='snakers4_silero-models_master',
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "...\torch\hub.py", line 143, in _parse_repo_info
  repo_owner, repo_name = repo_info.split('/')
  ^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1) 

The error seems to be related to how torch.hub.load() is parsing the repository name. The previous code was saved in a different folder and worked fine, but now in a new folder it fails.

I've tried checking if snakers4_silero-models_master is the correct format, the folder exists locally in the PyTorch cache

What's the correct way to load Silero TTS model using torch.hub? Should I use a GitHub URL instead of a local folder name? How do I fix this error?

Python 3.10, Windows

python windows pytorch valueerror