Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
symlink to voice model
Browse files
app.py
CHANGED
@@ -4,13 +4,13 @@ import time
|
|
4 |
import requests
|
5 |
from subprocess import Popen, PIPE
|
6 |
import threading
|
|
|
7 |
import gradio as gr
|
8 |
|
9 |
-
|
10 |
def run_xvaserver():
|
11 |
try:
|
12 |
# start the process without waiting for a response
|
13 |
-
print('Running xVAServer subprocess
|
14 |
xvaserver = Popen(['python', 'server.py'], stdout=PIPE, stderr=PIPE, universal_newlines=True)
|
15 |
except:
|
16 |
print('Could not run xVASynth.')
|
@@ -32,7 +32,7 @@ def run_xvaserver():
|
|
32 |
print('xVAServer running on port 8008')
|
33 |
|
34 |
# load default voice model
|
35 |
-
|
36 |
|
37 |
predicted = predict('test', 1.0)
|
38 |
print(predicted)
|
@@ -55,6 +55,14 @@ def run_xvaserver():
|
|
55 |
xvaserver.wait()
|
56 |
|
57 |
def load_model():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
model_type = 'xVAPitch'
|
59 |
language = 'en'
|
60 |
|
|
|
4 |
import requests
|
5 |
from subprocess import Popen, PIPE
|
6 |
import threading
|
7 |
+
# from huggingface_hub import hf_hub_download
|
8 |
import gradio as gr
|
9 |
|
|
|
10 |
def run_xvaserver():
|
11 |
try:
|
12 |
# start the process without waiting for a response
|
13 |
+
print('Running xVAServer subprocess...\n')
|
14 |
xvaserver = Popen(['python', 'server.py'], stdout=PIPE, stderr=PIPE, universal_newlines=True)
|
15 |
except:
|
16 |
print('Could not run xVASynth.')
|
|
|
32 |
print('xVAServer running on port 8008')
|
33 |
|
34 |
# load default voice model
|
35 |
+
load_model()
|
36 |
|
37 |
predicted = predict('test', 1.0)
|
38 |
print(predicted)
|
|
|
55 |
xvaserver.wait()
|
56 |
|
57 |
def load_model():
|
58 |
+
model_name = "Pendrokar/TorchMoji"
|
59 |
+
# model_path = hf_hub_download(repo_id=model_name, filename="ccby_nvidia_hifi_6670_M.pt")
|
60 |
+
# model_json_path = hf_hub_download(repo_id=model_name, filename="ccby_nvidia_hifi_6670_M.json")
|
61 |
+
model_path = '/tmp/hfcache/models--Pendrokar--xvapitch_nvidia_6670/snapshots/2e138a7c459fb1cb1182dd7bc66813f5325d30fd/ccby_nvidia_hifi_6670_M.pt'
|
62 |
+
model_json_path = '/tmp/hfcache/models--Pendrokar--xvapitch_nvidia_6670/snapshots/2e138a7c459fb1cb1182dd7bc66813f5325d30fd/ccby_nvidia_hifi_6670_M.json'
|
63 |
+
os.symlink(model_path, os.path.join('./models/ccby/', os.path.basename(model_path)))
|
64 |
+
os.symlink(model_json_path, os.path.join('./models/ccby/', os.path.basename(model_json_path)))
|
65 |
+
|
66 |
model_type = 'xVAPitch'
|
67 |
language = 'en'
|
68 |
|