hc20k/LLMChat

silero.py dependency gives error on os.mkdir("models/torch") if dir does not exist

Opened this issue · 0 comments

If the silero.py module is being used and the models/torch directory does not exist under the LLMChat working directory, an error is thrown after running LLMChat main.py stating that the file/directory does not exist rather than creating the directory as expected. This occurred on a new AWS EC2 instance running Ubuntu 22.04 LTS. Once the directory is manually created, the module initializes appropriately.

See #23 for original context, as follows. Confirmed via resolution of this issue that the two issues are separate and unrelated.

[11-20 07:49:02] [client.py:42] WARNING - Discord.active_channels = "all", bot will interact with every channel!
[11-20 07:49:02] [client.py:603] INFO - logging in using static token
[11-20 07:49:03] [gateway.py:563] INFO - Shard ID None has connected to Gateway (Session ID: [REDACTED]).
[11-20 07:49:05] [client.py:497] INFO - Logged in as [REDACTED]
[11-20 07:49:05] [client.py:157] INFO - LLM: openai
[11-20 07:49:05] [oai.py:65] DEBUG - Updating tokenizer encoding for gpt-4
[11-20 07:49:06] [client.py:169] INFO - Current model: gpt-4
[11-20 07:49:06] [client.py:135] INFO - TTS: silero
[11-20 07:49:14] [client.py:515] ERROR - Ignoring exception in on_ready
Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/site-packages/discord/client.py", line 441, in _run_event
    await coro(*args, **kwargs)
  File "/home/ubuntu/LLMChat/llmchat/client.py", line 508, in on_ready
    await self.setup_tts()
  File "/home/ubuntu/LLMChat/llmchat/client.py", line 146, in setup_tts
    self.tts = SileroTTS(*params)
  File "/home/ubuntu/LLMChat/llmchat/tts_sources/silero.py", line 20, in __init__
    os.mkdir("models/torch/")
FileNotFoundError: [Errno 2] No such file or directory: 'models/torch/'