Closed BIGdeadLock closed 2 months ago
Swap branch
On Wed 21 Aug 2024 at 08:47, BIGdeadLock @.***> wrote:
I'm trying to run the command:
python s2s_pipeline.py --recv_host localhost --send_host localhost --device mps
As mention in the guide to run it on mac use the --device mps flag.
When doing so I'm getting the following error:
raise ValueError(f"Some specified arguments are not used by the HfArgumentParser: {remaining_args}")
ValueError: Some specified arguments are not used by the HfArgumentParser: ['--device', 'mps']
— Reply to this email directly, view it on GitHub https://github.com/huggingface/speech-to-speech/issues/26, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASVG6CVO7GLSGJXWGBSMEBLZSRAYHAVCNFSM6AAAAABM3NVIY2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ3TOMZSGE2TMMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
@RonanKMcGovern
Oh, did not see the mps support branch. Will try!
@RonanKMcGovern
Getting a different error now:
from MeloTTS.melo.api import TTS
ModuleNotFoundError: No module named 'MeloTTS'
pip install does not work. Have any suggestions?
Update:
git clone https://github.com/myshell-ai/MeloTTS.git
To the TTS folder. After running the same command again I still got an error with the relative paths in MeloTTS.
To fix it I went into MeloTTS and changed:
from MeloTTS.melo.api import TTS -> from .MeloTTS.melo.api import TTS
At the melo package I changed all imports to be ..
relative.
After that I tried pip install -r requirements.txt
in the MeloTTS repo. I got a error on the cached_path package so I commented it out. Then the installation went OK.
from TTS.melotts import MeloTTSHandler
File "/Users/eden.yavin/Projects/speech-to-speech/TTS/melotts.py", line 1, in <module>
from .MeloTTS.melo.api import TTS
File "/Users/eden.yavin/Projects/speech-to-speech/TTS/MeloTTS/melo/api.py", line 13, in <module>
from . import utils
File "/Users/eden.yavin/Projects/speech-to-speech/TTS/MeloTTS/melo/utils.py", line 13, in <module>
from ..melo.text.cleaner import clean_text
File "/Users/eden.yavin/Projects/speech-to-speech/TTS/MeloTTS/melo/text/cleaner.py", line 1, in <module>
from . import chinese, japanese, english, chinese_mix, korean, french, spanish
File "/Users/eden.yavin/Projects/speech-to-speech/TTS/MeloTTS/melo/text/japanese.py", line 367, in <module>
_TAGGER = MeCab.Tagger()
File "/Users/eden.yavin/Projects/speech-to-speech/venv/lib/python3.9/site-packages/MeCab/__init__.py", line 139, in __init__
raise RuntimeError(error_info(rawargs)) from ee
RuntimeError:
----------------------------------------------------------
Failed initializing MeCab. Please see the README for possible solutions:
https://github.com/SamuraiT/mecab-python3#common-issues
If you are still having trouble, please file an issue here, and include the
ERROR DETAILS below:
https://github.com/SamuraiT/mecab-python3/issues
issueを英語で書く必要はありません。
------------------- ERROR DETAILS ------------------------
arguments:
default dictionary path: /Users/eden.yavin/Projects/speech-to-speech/venv/lib/python3.9/site-packages/unidic/dicdir
[ifs] no such file or directory: /Users/eden.yavin/Projects/speech-to-speech/venv/lib/python3.9/site-packages/unidic/dicdir/mecabrc
----------------------------------------------------------
Update:
python -m unidic download
Did you manage to get it to work?
I need to work on the setup, sorry, I should get there soon
@andimarafioti
I'm having trouble with the
python -m unidic download
For some reason the download gets stuck at 140/520 MB.
Some people are having other problems, you can follow them here: https://github.com/huggingface/speech-to-speech/pull/20 I'm trying to debug it
@andimarafioti
managed to finish the download after restarting the program
@andimarafioti
Next error on the schedule:
ImportError: cannot import name 'TextIteratorStreamer' from 'transformers' (/Users/eden.yavin/Projects/speech-to-speech/venv/lib/python3.9/site-packages/transformers/__init__.py)
melotts downgrades the transformer version, just do
pip install -r requirements.txt
When you run the code, the default will be parler. I just fixed a bug with it, so you can do git pull
to run with it. Otherwise, you can choose to test with melo as tts, for it pass --tts melo
to the python call. The video I uploaded was using melotts
I install the requirements again and did git pull
. Also updated transformers to 4.43.0
@andimarafioti
I ran the python s2s_pipeline.py --mode local --device mps --lm_model_name HuggingFaceTB/SmolLM-360M-Instruct
command and it works!
Running the command:
python listen_and_play.py --host localhost --device mps --lm_model_name HuggingFaceTB/SmolLM-360M-Instruct
(Which I don't know its purpuse)
raised the error:
File "/Users/eden.yavin/Projects/speech-to-speech/listen_and_play.py", line 126, in <module>
listen_and_play(**vars(listen_and_play_kwargs))
File "/Users/eden.yavin/Projects/speech-to-speech/listen_and_play.py", line 42, in listen_and_play
send_socket.connect((host, send_port))
ConnectionRefusedError: [Errno 61] Connection refused
@andimarafioti
Also for some reason the llm used is phi although I passed --lm_model_name HuggingFaceTB/SmolLM-360M-Instruct
.
Having trouble with the melo though if pass the flag --tts melo
Ok it is still all about the relative paths. Had to change
from melo.text.ko_dictionary import english_dictionary, etc_dictionary -> from ...melo.text.ko_dictionary import english_dictionary, etc_dictionary
Working on doing the same to other imports
Seems that doing that and pip install cached-path
did the trick. The response time and voice is a lot better!
(I love that live ticker... @BIGdeadLock 😁)
You don't need the listen_and_play command when running ni local mode :)
I think the issue with the relative paths is because you cloned the repo inside of this one and/or didn't install melo.
@andimarafioti Installing it did not work unfortunately.
What about the lm flag?
I made it work with tts parler by moving from TTS.melotts import MeloTTSHandler
to under elif module_kwargs.tts == 'melo':
so that can avoid install MeloTTS...
@ArvinZhuang
But what if you want to use MeloTTS? I cloned it to the TTS dir and it worked
@BIGdeadLock for the lm flag, the smol model doesn't work with MLX-LM so as a quick fix I overwrote it. I now pushed a change to let you choose the Language Model implementation. By default it uses transformers which will work with the SMOL LM. Let me know how it goes!
@ArvinZhuang I love that idea. Pushed it to the PR, thanks!
So... are we now at a point where macOS should work flawlessly? @andimarafioti
Yes! I merged the PR to main. Now the uv pip install -r requirements.txt
should work for melo as well. There is after the python -m unidic download
that you still need to do if you want to run with melo, but I decided to leave that as a warning if it fails since it adds 550mb to the install, and there wasn't a clean way to do it. I also added a flag to run locally with mac (sets devices and models to what I think works best 😅) And I adapted the readme :)
Thanks, will try it now :-)
I'm trying to run the command:
As mention in the guide to run it on mac use the --device mps flag.
When doing so I'm getting the following error: