#!/usr/bin/env bash # Copyright 2024 Jinchuan Tian, Carnegie Mellon University, jinchuat@andrew.cmu.edu # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) # Build environment for SpeechLM infernece log() { local fname=${BASH_SOURCE[1]##*/} echo -e "$(date '+%Y-%m-%dT%H:%M:%S') (${fname}:${BASH_LINENO[0]}:${FUNCNAME[1]}) $*" } stage=1 stop_stage=100 . utils/parse_options.sh if [ ! -f activate_python.sh ]; then log "Please run the env.sh to install conda environment" && exit 1; else . ./activate_python.sh fi export PYTHONPATH=${PYTHONPATH}:./UniAudio/codec if [ ${stage} -le 1 ] && [ ${stop_stage} -ge 1 ]; then log "start SpeechLM inference for TTS task" python3 -m espnet2.bin.speechlm_inference \ --ngpu 1 \ --nbest 1 \ --model_file exp/speechlm_asr_tts_1.7B/31_40epoch.pth \ --train_config exp/speechlm_asr_tts_1.7B/config.yaml \ --config conf/decode_tts.yaml \ --data_path_and_name_and_type dump/raw_codec_ssl_tts_librispeech/test_clean/data.json,_,dataset_json \ --output_dir exp/speechlm_asr_tts_1.7B/tts_inference fi