OpenVoice
OpenVoice copied to clipboard
No module named 'commons'
I wanted to integrate OpenVoice to my multimodal AI assisstant, however there is a problem when I'm trying to run the api outside the project folder. If I run the file inside the OpenVoice folder it works just fine, however when I try to run the main file outside the project folder, that's where things go wrong.
Also let's say I refractor the api.py, the next problem arises when finding 'text' which is a folder... To be honest, I'm still learning python and this is where I got stuck at when implementing it.
Error:
D:\AI\VoiceTTS\STS\Multimodal\tts>python tts.py
Traceback (most recent call last):
File "D:\AI\VoiceTTS\STS\Multimodal\tts\tts.py", line 1, in <module>
from OpenVoice.api import tts
File "D:\AI\VoiceTTS\STS\Multimodal\tts\OpenVoice\api.py", line 6, in <module>
import commons
ModuleNotFoundError: No module named 'commons'
File Structure tts.py (Doesn't work cuz commons cannot be found) OpenVoice |--- tts(copy).py #Works just fine |--- api.py |--- commons.py |--- other files from repo
tts.py
from OpenVoice.api import tts
tts("hi there", "output.wav", "reference.wav")