mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
feat: revert adding translate feature #2
This commit is contained in:
@@ -197,7 +197,6 @@ def worker():
|
||||
from modules.upscaler import perform_upscale
|
||||
from modules.flags import Performance
|
||||
from modules.meta_parser import get_metadata_parser
|
||||
from modules.translator import translate2en
|
||||
|
||||
pid = os.getpid()
|
||||
print(f'Started worker with PID {pid}')
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import translators
|
||||
from functools import lru_cache
|
||||
|
||||
@lru_cache(maxsize=32, typed=False)
|
||||
def translate2en(text, element):
|
||||
if not text:
|
||||
return text
|
||||
|
||||
try:
|
||||
result = translators.translate_text(text,to_language='en')
|
||||
print(f'[Parameters] Translated {element}: {result}')
|
||||
return result
|
||||
except Exception as e:
|
||||
print(f'[Parameters] Error during translation of {element}: {e}')
|
||||
return text
|
||||
Reference in New Issue
Block a user