Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
em value fix
Browse files- app.py +12 -12
- gr_client.py +14 -15
app.py
CHANGED
@@ -146,10 +146,10 @@ class LocalBlocksDemo(BlocksDemo):
|
|
146 |
|
147 |
arpabet_html = ''
|
148 |
if voice == 'x_selpahi':
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
else:
|
154 |
arpabet_html = '<h6>ARPAbet & Durations</h6>'
|
155 |
arpabet_html += '<table style="margin: 0 var(--size-2)"><tbody><tr>'
|
@@ -176,18 +176,18 @@ class LocalBlocksDemo(BlocksDemo):
|
|
176 |
+ '</td> '
|
177 |
arpabet_html += '<tr></tbody></table>'
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
|
184 |
return [
|
185 |
save_path,
|
186 |
arpabet_html,
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
json_data
|
192 |
]
|
193 |
|
|
|
146 |
|
147 |
arpabet_html = ''
|
148 |
if voice == 'x_selpahi':
|
149 |
+
em_angry = 0
|
150 |
+
em_happy = 0
|
151 |
+
em_sad = 0
|
152 |
+
em_surprise = 0
|
153 |
else:
|
154 |
arpabet_html = '<h6>ARPAbet & Durations</h6>'
|
155 |
arpabet_html += '<table style="margin: 0 var(--size-2)"><tbody><tr>'
|
|
|
176 |
+ '</td> '
|
177 |
arpabet_html += '<tr></tbody></table>'
|
178 |
|
179 |
+
em_angry = round(json_data['em_angry'][0], 2),
|
180 |
+
em_happy = round(json_data['em_happy'][0], 2),
|
181 |
+
em_sad = round(json_data['em_sad'][0], 2),
|
182 |
+
em_surprise = round(json_data['em_surprise'][0], 2),
|
183 |
|
184 |
return [
|
185 |
save_path,
|
186 |
arpabet_html,
|
187 |
+
em_angry,
|
188 |
+
em_happy,
|
189 |
+
em_sad,
|
190 |
+
em_surprise,
|
191 |
json_data
|
192 |
]
|
193 |
|
gr_client.py
CHANGED
@@ -72,7 +72,7 @@ default_text = {
|
|
72 |
"hi": "यह मेरी आवाज़ कैसी लगती है।",
|
73 |
"hu": "Így hangzik a hangom.",
|
74 |
"it": "Così suona la mia voce.",
|
75 |
-
"jb": ".i ",
|
76 |
"jp": "これが私の声です。",
|
77 |
"ko": "여기 제 목소리가 어떤지 들어보세요.",
|
78 |
"la": "Haec est vox mea sonans.",
|
@@ -545,15 +545,14 @@ class BlocksDemo:
|
|
545 |
api_name="/predict"
|
546 |
)
|
547 |
|
548 |
-
json_data = json.loads(response.replace("'", '"'))
|
549 |
-
|
550 |
arpabet_html = ''
|
551 |
if voice == 'x_selpahi':
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
else:
|
|
|
557 |
arpabet_html = '<h6>ARPAbet & Durations</h6>'
|
558 |
arpabet_html += '<table style="margin: 0 var(--size-2)"><tbody><tr>'
|
559 |
arpabet_nopad = json_data['arpabet'].split('|PAD|')
|
@@ -579,18 +578,18 @@ class BlocksDemo:
|
|
579 |
+ '</td> '
|
580 |
arpabet_html += '<tr></tbody></table>'
|
581 |
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
|
587 |
return [
|
588 |
wav_path,
|
589 |
arpabet_html,
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
response
|
595 |
]
|
596 |
|
|
|
72 |
"hi": "यह मेरी आवाज़ कैसी लगती है।",
|
73 |
"hu": "Így hangzik a hangom.",
|
74 |
"it": "Così suona la mia voce.",
|
75 |
+
"jb": ".i ca'e gusni",
|
76 |
"jp": "これが私の声です。",
|
77 |
"ko": "여기 제 목소리가 어떤지 들어보세요.",
|
78 |
"la": "Haec est vox mea sonans.",
|
|
|
545 |
api_name="/predict"
|
546 |
)
|
547 |
|
|
|
|
|
548 |
arpabet_html = ''
|
549 |
if voice == 'x_selpahi':
|
550 |
+
em_angry = 0
|
551 |
+
em_happy = 0
|
552 |
+
em_sad = 0
|
553 |
+
em_surprise = 0
|
554 |
else:
|
555 |
+
json_data = json.loads(response.replace("'", '"'))
|
556 |
arpabet_html = '<h6>ARPAbet & Durations</h6>'
|
557 |
arpabet_html += '<table style="margin: 0 var(--size-2)"><tbody><tr>'
|
558 |
arpabet_nopad = json_data['arpabet'].split('|PAD|')
|
|
|
578 |
+ '</td> '
|
579 |
arpabet_html += '<tr></tbody></table>'
|
580 |
|
581 |
+
em_angry = round(json_data['em_angry'][0], 2),
|
582 |
+
em_happy = round(json_data['em_happy'][0], 2),
|
583 |
+
em_sad = round(json_data['em_sad'][0], 2),
|
584 |
+
em_surprise = round(json_data['em_surprise'][0], 2),
|
585 |
|
586 |
return [
|
587 |
wav_path,
|
588 |
arpabet_html,
|
589 |
+
em_angry,
|
590 |
+
em_happy,
|
591 |
+
em_sad,
|
592 |
+
em_surprise,
|
593 |
response
|
594 |
]
|
595 |
|