Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
çomment out symlink
Browse files
app.py
CHANGED
@@ -12,10 +12,11 @@ hf_model_name = "Pendrokar/xvapitch_nvidia"
|
|
12 |
hf_cache_models_path = '/home/user/.cache/huggingface/hub/models--Pendrokar--xvapitch_nvidia/snapshots/61b10e60b22bc21c1e072f72f1108b9c2b21e94c/'
|
13 |
models_path = '/home/user/.cache/huggingface/hub/models--Pendrokar--xvapitch_nvidia/snapshots/61b10e60b22bc21c1e072f72f1108b9c2b21e94c/'
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
19 |
|
20 |
voice_models = [
|
21 |
("Male #6671", "ccby_nvidia_hifi_6671_M"),
|
@@ -207,16 +208,15 @@ def predict(
|
|
207 |
'useCleanup': use_cleanup,
|
208 |
}
|
209 |
|
|
|
210 |
try:
|
211 |
response = requests.post('http://0.0.0.0:8008/synthesize', json=data, timeout=60)
|
212 |
response.raise_for_status() # If the response contains an HTTP error status code, raise an exception
|
213 |
# response_data = json.loads(response.text)
|
214 |
except requests.exceptions.RequestException as err:
|
215 |
print('Failed to synthesize!')
|
216 |
-
|
217 |
-
|
218 |
-
print(f.read())
|
219 |
-
return ['', err]
|
220 |
|
221 |
print('server.log contents:')
|
222 |
with open('resources/app/server.log', 'r') as f:
|
|
|
12 |
hf_cache_models_path = '/home/user/.cache/huggingface/hub/models--Pendrokar--xvapitch_nvidia/snapshots/61b10e60b22bc21c1e072f72f1108b9c2b21e94c/'
|
13 |
models_path = '/home/user/.cache/huggingface/hub/models--Pendrokar--xvapitch_nvidia/snapshots/61b10e60b22bc21c1e072f72f1108b9c2b21e94c/'
|
14 |
|
15 |
+
# FIXME: currently hardcoded in DeepMoji code
|
16 |
+
# try:
|
17 |
+
# os.symlink('/home/user/.cache/huggingface/hub/models--Pendrokar--TorchMoji/snapshots/58217568daaf64d3621245dd5c88c94e651a08d6', '/home/user/app/resources/app/plugins/deepmoji_plugings/model', target_is_directory=True)
|
18 |
+
# except:
|
19 |
+
# print('Failed to create symlink to DeepMoji model, may already be there.')
|
20 |
|
21 |
voice_models = [
|
22 |
("Male #6671", "ccby_nvidia_hifi_6671_M"),
|
|
|
208 |
'useCleanup': use_cleanup,
|
209 |
}
|
210 |
|
211 |
+
print('Synthesizing...')
|
212 |
try:
|
213 |
response = requests.post('http://0.0.0.0:8008/synthesize', json=data, timeout=60)
|
214 |
response.raise_for_status() # If the response contains an HTTP error status code, raise an exception
|
215 |
# response_data = json.loads(response.text)
|
216 |
except requests.exceptions.RequestException as err:
|
217 |
print('Failed to synthesize!')
|
218 |
+
save_path = ''
|
219 |
+
response = {text: 'Failed'}
|
|
|
|
|
220 |
|
221 |
print('server.log contents:')
|
222 |
with open('resources/app/server.log', 'r') as f:
|
resources/app/plugins/deepmoji_plugin/sentiment.py
CHANGED
@@ -391,9 +391,9 @@ def adjust_values(data=None):
|
|
391 |
data["hasDataChanged"] = True
|
392 |
|
393 |
prev_sentence = text_scores[0]
|
394 |
-
last_em_angry =
|
395 |
-
last_em_happy =
|
396 |
-
last_em_sad =
|
397 |
-
last_em_surprise =
|
398 |
|
399 |
return
|
|
|
391 |
data["hasDataChanged"] = True
|
392 |
|
393 |
prev_sentence = text_scores[0]
|
394 |
+
last_em_angry = float(0)
|
395 |
+
last_em_happy = float(0)
|
396 |
+
last_em_sad = float(0)
|
397 |
+
last_em_surprise = float(0)
|
398 |
|
399 |
return
|