Spaces:
Running
Running
Commit
·
7a28d1e
1
Parent(s):
6ebda43
japanese example
Browse files
app.py
CHANGED
|
@@ -55,15 +55,21 @@ model.load_checkpoint(
|
|
| 55 |
)
|
| 56 |
model.cuda()
|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
# This is for debugging purposes only
|
| 59 |
DEVICE_ASSERT_DETECTED=0
|
| 60 |
DEVICE_ASSERT_PROMPT=None
|
| 61 |
DEVICE_ASSERT_LANG=None
|
| 62 |
|
|
|
|
|
|
|
| 63 |
|
| 64 |
def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, voice_cleanup, no_lang_auto_detect, agree,):
|
| 65 |
if agree == True:
|
| 66 |
-
|
| 67 |
|
| 68 |
if language not in supported_languages:
|
| 69 |
gr.Warning("Language you put in is not in is not in our Supported Languages, please choose from dropdown")
|
|
@@ -408,6 +414,17 @@ examples = [
|
|
| 408 |
False,
|
| 409 |
True,
|
| 410 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 411 |
]
|
| 412 |
|
| 413 |
|
|
@@ -437,6 +454,7 @@ gr.Interface(
|
|
| 437 |
"cs",
|
| 438 |
"ar",
|
| 439 |
"zh-cn",
|
|
|
|
| 440 |
],
|
| 441 |
max_choices=1,
|
| 442 |
value="en",
|
|
|
|
| 55 |
)
|
| 56 |
model.cuda()
|
| 57 |
|
| 58 |
+
# it should be there just to be sure
|
| 59 |
+
if "ja" not in config.languages:
|
| 60 |
+
config.languages.append("ja")
|
| 61 |
+
|
| 62 |
# This is for debugging purposes only
|
| 63 |
DEVICE_ASSERT_DETECTED=0
|
| 64 |
DEVICE_ASSERT_PROMPT=None
|
| 65 |
DEVICE_ASSERT_LANG=None
|
| 66 |
|
| 67 |
+
#supported_languages=["en","es","fr","de","it","pt","pl","tr","ru","nl","cs","ar","zh-cn"]
|
| 68 |
+
supported_languages=config.languages
|
| 69 |
|
| 70 |
def predict(prompt, language, audio_file_pth, mic_file_path, use_mic, voice_cleanup, no_lang_auto_detect, agree,):
|
| 71 |
if agree == True:
|
| 72 |
+
|
| 73 |
|
| 74 |
if language not in supported_languages:
|
| 75 |
gr.Warning("Language you put in is not in is not in our Supported Languages, please choose from dropdown")
|
|
|
|
| 414 |
False,
|
| 415 |
True,
|
| 416 |
],
|
| 417 |
+
[
|
| 418 |
+
"かつて 六歳のとき、素晴らしい絵を見ました",
|
| 419 |
+
"ja",
|
| 420 |
+
"examples/female.wav",
|
| 421 |
+
None,
|
| 422 |
+
False,
|
| 423 |
+
False,
|
| 424 |
+
False,
|
| 425 |
+
True,
|
| 426 |
+
],
|
| 427 |
+
|
| 428 |
]
|
| 429 |
|
| 430 |
|
|
|
|
| 454 |
"cs",
|
| 455 |
"ar",
|
| 456 |
"zh-cn",
|
| 457 |
+
"ja"
|
| 458 |
],
|
| 459 |
max_choices=1,
|
| 460 |
value="en",
|