Spaces:
Running
on
Zero
Running
on
Zero
Upload 8 files
Browse files- tagger/tagger.py +10 -1
tagger/tagger.py
CHANGED
@@ -189,7 +189,7 @@ def convert_danbooru_to_e621_prompt(input_prompt: str = "", prompt_type: str = "
|
|
189 |
|
190 |
from translatepy import Translator
|
191 |
translator = Translator()
|
192 |
-
def
|
193 |
def translate_to_english(input: str):
|
194 |
try:
|
195 |
output = str(translator.translate(input, 'English'))
|
@@ -218,6 +218,15 @@ def translate_prompt(prompt: str = ""):
|
|
218 |
return ", ".join(outputs)
|
219 |
|
220 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
def translate_prompt_to_ja(prompt: str = ""):
|
222 |
def translate_to_japanese(input: str):
|
223 |
try:
|
|
|
189 |
|
190 |
from translatepy import Translator
|
191 |
translator = Translator()
|
192 |
+
def translate_prompt_old(prompt: str = ""):
|
193 |
def translate_to_english(input: str):
|
194 |
try:
|
195 |
output = str(translator.translate(input, 'English'))
|
|
|
218 |
return ", ".join(outputs)
|
219 |
|
220 |
|
221 |
+
def translate_prompt(input: str):
|
222 |
+
try:
|
223 |
+
output = str(translator.translate(input, 'English'))
|
224 |
+
except Exception as e:
|
225 |
+
output = input
|
226 |
+
print(e)
|
227 |
+
return output
|
228 |
+
|
229 |
+
|
230 |
def translate_prompt_to_ja(prompt: str = ""):
|
231 |
def translate_to_japanese(input: str):
|
232 |
try:
|