Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
voice-clone
Commits
61c8721d
"git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "c41f0b9e6c09c3751ff4f10aff78e9da752c5f28"
Commit
61c8721d
authored
Aug 01, 2024
by
chenpangpang
Browse files
feat: 修改gradio需要的模型、依赖库、语言
parent
655551cc
Pipeline
#1458
canceled with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
8 deletions
+30
-8
Dockerfile
Dockerfile
+21
-0
voice-clone/app.py
voice-clone/app.py
+7
-7
voice-clone/requirements.txt
voice-clone/requirements.txt
+2
-1
No files found.
Dockerfile
0 → 100644
View file @
61c8721d
FROM
image.sourcefind.cn:5000/gpu/admin/base/jupyterlab-pytorch:2.2.0-python3.10-cuda12.1-ubuntu22.04 as base
ARG
IMAGE=voice-clone
ARG
IMAGE_UPPER=voice-clone
ARG
BRANCH=gpu
RUN
cd
/root
&&
git clone
-b
$BRANCH
http://developer.hpccube.com/codes/chenpangpang/
$IMAGE
.git
WORKDIR
/root/$IMAGE/$IMAGE_UPPER
RUN
pip
install
-r
requirements.txt
#########
# Prod #
#########
FROM
image.sourcefind.cn:5000/gpu/admin/base/jupyterlab-pytorch:2.2.0-python3.10-cuda12.1-ubuntu22.04
ARG
IMAGE=voice-clone
ARG
IMAGE_UPPER=voice-clone
COPY
chenyh/$IMAGE/frpc_linux_amd64_v0.2 /opt/conda/lib/python3.10/site-packages/gradio/
RUN
chmod
+x /opt/conda/lib/python3.10/site-packages/gradio/frpc_linux_amd64_v0.2
COPY
chenyh/$IMAGE/coqui/XTTS-v2 /root/.local/share/tts/tts_models--multilingual--multi-dataset--xtts_v2
COPY
--from=base /opt/conda/lib/python3.10/site-packages /opt/conda/lib/python3.10/site-packages
COPY
--from=base /root/$IMAGE/$IMAGE_UPPER /root/$IMAGE_UPPER
COPY
--from=base /root/$IMAGE/启动器.ipynb /root/$IMAGE/start.sh /root/
\ No newline at end of file
voice-clone/app.py
View file @
61c8721d
import
spaces
import
gradio
as
gr
import
gradio
as
gr
import
torch
import
torch
from
TTS.api
import
TTS
from
TTS.api
import
TTS
...
@@ -11,7 +10,6 @@ device = "cuda"
...
@@ -11,7 +10,6 @@ device = "cuda"
tts
=
TTS
(
"tts_models/multilingual/multi-dataset/xtts_v2"
).
to
(
device
)
tts
=
TTS
(
"tts_models/multilingual/multi-dataset/xtts_v2"
).
to
(
device
)
@
spaces
.
GPU
(
enable_queue
=
True
)
def
clone
(
text
,
audio
,
language
):
def
clone
(
text
,
audio
,
language
):
tts
.
tts_to_file
(
text
=
text
,
speaker_wav
=
audio
,
language
=
language
,
file_path
=
"./output.wav"
)
tts
.
tts_to_file
(
text
=
text
,
speaker_wav
=
audio
,
language
=
language
,
file_path
=
"./output.wav"
)
return
"./output.wav"
return
"./output.wav"
...
@@ -21,10 +19,12 @@ iface = gr.Interface(fn=clone,
...
@@ -21,10 +19,12 @@ iface = gr.Interface(fn=clone,
inputs
=
[
gr
.
Textbox
(
label
=
'Text'
),
inputs
=
[
gr
.
Textbox
(
label
=
'Text'
),
gr
.
Audio
(
type
=
'filepath'
,
label
=
'Voice reference audio file'
),
gr
.
Audio
(
type
=
'filepath'
,
label
=
'Voice reference audio file'
),
gr
.
Dropdown
(
label
=
'Language'
,
gr
.
Dropdown
(
label
=
'Language'
,
choices
=
[
'en - English'
,
'fr - French'
,
'ar - Arabic'
,
'es - Spanish'
,
# choices=['en - English', 'fr - French', 'ar - Arabic', 'es - Spanish',
'zh - Chinese'
,
'ru - Russian'
,
'pt - Portuguese'
,
'it - Italian'
,
# 'zh - Chinese', 'ru - Russian', 'pt - Portuguese', 'it - Italian',
'de - German'
,
'nl - Dutch'
])],
# 'de - German', 'nl - Dutch'])],
outputs
=
gr
.
Audio
(
type
=
'filepath'
),
choices
=
[
'en'
,
'es'
,
'fr'
,
'de'
,
'it'
,
'pt'
,
'pl'
,
'tr'
,
'ru'
,
'nl'
,
'cs'
,
'ar'
,
'zh-cn'
,
'hu'
,
'ko'
,
'ja'
,
'hi'
])],
outputs
=
gr
.
Audio
(
type
=
'filepath'
,
label
=
'Generated audio file'
),
title
=
'Voice Clone'
,
title
=
'Voice Clone'
,
description
=
"""
description
=
"""
by [Tony Assi](https://www.tonyassi.com/)
by [Tony Assi](https://www.tonyassi.com/)
...
@@ -43,4 +43,4 @@ iface = gr.Interface(fn=clone,
...
@@ -43,4 +43,4 @@ iface = gr.Interface(fn=clone,
"./audio/Megan-Fox.mp3"
,
"en - English"
],
"./audio/Megan-Fox.mp3"
,
"en - English"
],
[
"Hey there, it's me Jeff Goldblum. Type in whatever you'd like me to say."
,
[
"Hey there, it's me Jeff Goldblum. Type in whatever you'd like me to say."
,
"./audio/Jeff-Goldblum.mp3"
,
"en - English"
],
])
"./audio/Jeff-Goldblum.mp3"
,
"en - English"
],
])
iface
.
launch
()
iface
.
launch
(
server_name
=
'0.0.0.0'
,
share
=
True
)
\ No newline at end of file
voice-clone/requirements.txt
View file @
61c8721d
TTS
TTS
torch
torch
\ No newline at end of file
gradio==4.26.0
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment