From 7462bf183820796e780a29f4a99d05ddc146f8d5 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 7 Apr 2023 00:26:37 -0400 Subject: [PATCH] include ffmpeg, etc dependencies --- tts/vits/Dockerfile | 5 +++++ tts/vits/infer_ts_job.py | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tts/vits/Dockerfile b/tts/vits/Dockerfile index acb5efe..d9a6de7 100644 --- a/tts/vits/Dockerfile +++ b/tts/vits/Dockerfile @@ -17,6 +17,8 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone # Notes on packages: # * espeak-ng is critical for speech +# * ffmpeg: file length detection +# * libmagic: mimetype detection, other magic bytes operations in Python # * screen: not sure why included; I threw in tmux and curl for good measure # * unzip: not sure why included, but perhaps downloading models RUN DEBIAN_FRONTEND=noninteractive apt-get update \ @@ -24,6 +26,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \ build-essential \ curl \ espeak-ng \ + ffmpeg \ + libmagic-dev \ + libmagic1 \ python3-dev \ python3-pip \ python3.10 \ diff --git a/tts/vits/infer_ts_job.py b/tts/vits/infer_ts_job.py index aa6a65b..95a5b47 100644 --- a/tts/vits/infer_ts_job.py +++ b/tts/vits/infer_ts_job.py @@ -10,7 +10,7 @@ from tsvitsfe import TSVITSFE # For metadata import subprocess import magic -import os +import sys def print_gpu_info(): print('========================================') @@ -119,16 +119,16 @@ if __name__ == "__main__": input_text = open(args.input_text_filename, 'r').read().strip() print(f'Input text: {input_text}') - + vits_fe = TSVITSFE() print("Loading model...") vits_fe.load(args.checkpoint,args.config,args.device) print("Doing inference...") out_aud = vits_fe.infer(input_text) - + out_fn = args.output_audio_filename sf.write(out_fn, out_aud, vits_fe.hps.data.sampling_rate) print(f"Wrote audio file {out_fn}") generate_metadata_file(out_fn, args.output_metadata_filename) - \ No newline at end of file +