Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -36,6 +36,7 @@ myOutputs = [
|
|
36 |
]
|
37 |
|
38 |
def create(prompt, style):
|
|
|
39 |
chinese_translation = translator(prompt, src_lang="ltz_Latn", tgt_lang="zho_Hans")
|
40 |
if style == "Aquarell":
|
41 |
ernie_style = '水彩'
|
@@ -53,7 +54,7 @@ def create(prompt, style):
|
|
53 |
ernie_style = '探索无限'
|
54 |
else:
|
55 |
ernie_style = '水彩'
|
56 |
-
|
57 |
try:
|
58 |
artworks = model_ernie.generate_image(
|
59 |
text_prompts = chinese_translation[0]['translation_text'],
|
@@ -66,13 +67,14 @@ def create(prompt, style):
|
|
66 |
error = translator(error_text, src_lang="zho_Hans", tgt_lang="ltz_Latn")
|
67 |
warnung = "Feeler! : " + str(error[0]['translation_text'])
|
68 |
return None, warnung
|
69 |
-
|
70 |
# english_back_translation = translator(chinese_translation[0]['translation_text'], src_lang="zho_Hans", tgt_lang="eng_Latn")
|
71 |
-
|
72 |
# print(artworks)
|
73 |
# print(artworks[0])
|
74 |
# return translation
|
75 |
# return artworks[0], translation
|
|
|
76 |
return "nothing"
|
77 |
|
78 |
demo = gr.Interface(
|
|
|
36 |
]
|
37 |
|
38 |
def create(prompt, style):
|
39 |
+
"""
|
40 |
chinese_translation = translator(prompt, src_lang="ltz_Latn", tgt_lang="zho_Hans")
|
41 |
if style == "Aquarell":
|
42 |
ernie_style = '水彩'
|
|
|
54 |
ernie_style = '探索无限'
|
55 |
else:
|
56 |
ernie_style = '水彩'
|
57 |
+
|
58 |
try:
|
59 |
artworks = model_ernie.generate_image(
|
60 |
text_prompts = chinese_translation[0]['translation_text'],
|
|
|
67 |
error = translator(error_text, src_lang="zho_Hans", tgt_lang="ltz_Latn")
|
68 |
warnung = "Feeler! : " + str(error[0]['translation_text'])
|
69 |
return None, warnung
|
70 |
+
|
71 |
# english_back_translation = translator(chinese_translation[0]['translation_text'], src_lang="zho_Hans", tgt_lang="eng_Latn")
|
72 |
+
# translation = "chinesësch Iwwersetzung : " + str(chinese_translation[0]['translation_text']) + " ; englesch Réckiwwersetzung : " + str(english_back_translation[0]['translation_text'])
|
73 |
# print(artworks)
|
74 |
# print(artworks[0])
|
75 |
# return translation
|
76 |
# return artworks[0], translation
|
77 |
+
"""
|
78 |
return "nothing"
|
79 |
|
80 |
demo = gr.Interface(
|