mirror of
https://github.com/Physton/sd-webui-prompt-all-in-one.git
synced 2026-05-01 03:31:41 +00:00
Optimize the translation code and significantly improve the batch translation speed
Optimize the translation code and significantly improve the batch translation speed Former-commit-id: c58d70fc4eb5960e8907c00a82bc662f95933615
This commit is contained in:
@@ -104,6 +104,8 @@ def translate(text, from_lang, to_lang, api, api_config = {}):
|
||||
if item == None:
|
||||
translate_indexes.append(index)
|
||||
translate_texts.append(text[index])
|
||||
if len(translate_texts) < 1:
|
||||
return _translate_result(True, '', texts)
|
||||
result = translator.translate_batch(translate_texts)
|
||||
for index in range(len(result)):
|
||||
item = result[index]
|
||||
|
||||
Reference in New Issue
Block a user