Views
No views yet

1git clone https://github.com/huggingface/speech-to-speech.git
2cd speech-to-speechuv pip install -r requirements.txtrequirements_mac.txt file instead:uv pip install -r requirements_mac.txtpython -m unidic downloaddocker compose uppython s2s_pipeline.py --recv_host 0.0.0.0 --send_host 0.0.0.0python listen_and_play.py --host <IP address of your server>python s2s_pipeline.py --local_mac_optimal_settings--device mps to use MPS for all models.
1python s2s_pipeline.py \
2 --recv_host 0.0.0.0 \
3 --send_host 0.0.0.0 \
4 --lm_model_name microsoft/Phi-3-mini-4k-instruct \
5 --init_chat_role system \
6 --stt_compile_mode reduce-overhead \
7 --tts_compile_mode default reduce-overhead, max-autotune).1python s2s_pipeline.py \
2 --stt_model_name large-v3 \
3 --language zh \
4 --mlx_lm_model_name mlx-community/Meta-Llama-3.1-8B-Instruct \1python s2s_pipeline.py \
2 --stt_model_name large-v3 \
3 --language zh \
4 --mlx_lm_model_name mlx-community/Meta-Llama-3.1-8B-Instruct \1python s2s_pipeline.py \
2 --local_mac_optimal_settings \
3 --device mps \
4 --stt_model_name large-v3 \
5 --language zh \
6 --mlx_lm_model_name mlx-community/Meta-Llama-3.1-8B-Instruct-4bit \1python s2s_pipeline.py \
2 --local_mac_optimal_settings \
3 --device mps \
4 --stt_model_name large-v3 \
5 --language zh \
6 --mlx_lm_model_name mlx-community/Meta-Llama-3.1-8B-Instruct-4bit \model_name, torch_dtype, and device are exposed for each part leveraging the Transformers' implementations: Speech to Text, Language Model, and Text to Speech. Specify the targeted pipeline part with the corresponding prefix:stt (Speech to Text)lm (Language Model)tts (Text to Speech)--lm_model_name google/gemma-2b-it_gen_, e.g., --stt_gen_max_new_tokens 128. These parameters can be added to the pipeline part's arguments class if not already exposed (see LanguageModelHandlerArguments for example).--thresh: Threshold value to trigger voice activity detection.--min_speech_ms: Minimum duration of detected voice activity to be considered speech.--min_silence_ms: Minimum length of silence intervals for segmenting speech, balancing sentence cutting and latency reduction.--init_chat_role: Defaults to None. Sets the initial role in the chat template, if applicable. Refer to the model's card to set this value (e.g. for Phi-3-mini-4k-instruct you have to set --init_chat_role system)--init_chat_prompt: Defaults to "You are a helpful AI assistant." Required when setting --init_chat_role.--description: Sets the description for Parler-TTS generated voice. Defaults to: "A female speaker with a slightly low-pitched voice delivers her words quite expressively, in a very confined sounding environment with clear audio quality. She speaks very fast."--play_steps_s: Specifies the duration of the first chunk sent during streaming output from Parler-TTS, impacting readiness and decoding steps.1@misc{Silero VAD,
2 author = {Silero Team},
3 title = {Silero VAD: pre-trained enterprise-grade Voice Activity Detector (VAD), Number Detector and Language Classifier},
4 year = {2021},
5 publisher = {GitHub},
6 journal = {GitHub repository},
7 howpublished = {\url{https://github.com/snakers4/silero-vad}},
8 commit = {insert_some_commit_here},
9 email = {hello@silero.ai}
10}1@misc{gandhi2023distilwhisper,
2 title={Distil-Whisper: Robust Knowledge Distillation via Large-Scale Pseudo Labelling},
3 author={Sanchit Gandhi and Patrick von Platen and Alexander M. Rush},
4 year={2023},
5 eprint={2311.00430},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}1@misc{lacombe-etal-2024-parler-tts,
2 author = {Yoach Lacombe and Vaibhav Srivastav and Sanchit Gandhi},
3 title = {Parler-TTS},
4 year = {2024},
5 publisher = {GitHub},
6 journal = {GitHub repository},
7 howpublished = {\url{https://github.com/huggingface/parler-tts}}
8}