add docker
This commit is contained in:
13
Dockerfile
Normal file
13
Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
FROM python:3.9-slim
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
build-essential libsndfile1 \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN pip install -e .
|
||||||
|
RUN python -m unidic download
|
||||||
|
RUN python melo/init_downloads.py
|
||||||
|
|
||||||
|
CMD ["python", "./melo/app.py", "--port", "8800"]
|
||||||
@@ -53,7 +53,7 @@ with gr.Blocks() as demo:
|
|||||||
@click.command()
|
@click.command()
|
||||||
@click.option('--share', '-s', is_flag=True, show_default=True, default=False, help="Expose a publicly-accessible shared Gradio link usable by anyone with the link. Only share the link with people you trust.")
|
@click.option('--share', '-s', is_flag=True, show_default=True, default=False, help="Expose a publicly-accessible shared Gradio link usable by anyone with the link. Only share the link with people you trust.")
|
||||||
@click.option('--host', '-h', default=None)
|
@click.option('--host', '-h', default=None)
|
||||||
@click.option('--port', '-p', default=None)
|
@click.option('--port', '-p', type=int, default=None)
|
||||||
def main(share, host, port):
|
def main(share, host, port):
|
||||||
demo.queue(api_open=False, default_concurrency_limit=10).launch(show_api=False, share=share, server_name=host, server_port=port)
|
demo.queue(api_open=False, default_concurrency_limit=10).launch(show_api=False, share=share, server_name=host, server_port=port)
|
||||||
|
|
||||||
|
|||||||
14
melo/init_downloads.py
Normal file
14
melo/init_downloads.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
from melo.api import TTS
|
||||||
|
device = 'auto'
|
||||||
|
models = {
|
||||||
|
'EN': TTS(language='EN', device=device),
|
||||||
|
'ES': TTS(language='ES', device=device),
|
||||||
|
'FR': TTS(language='FR', device=device),
|
||||||
|
'ZH': TTS(language='ZH', device=device),
|
||||||
|
'JP': TTS(language='JP', device=device),
|
||||||
|
'KR': TTS(language='KR', device=device),
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user