Update app/webui/process.py
Browse files- app/webui/process.py +2 -4
app/webui/process.py
CHANGED
|
@@ -162,8 +162,8 @@ def translator_sec(
|
|
| 162 |
try:
|
| 163 |
language = Language(target_lang)
|
| 164 |
except Exception as e:
|
| 165 |
-
raise gr.Error(f"An unexpected error occurred: {e}")
|
| 166 |
-
init_translation = gtranslator.translate(source_text, language)
|
| 167 |
else:
|
| 168 |
init_translation = one_chunk_initial_translation(
|
| 169 |
source_lang, target_lang, source_text
|
|
@@ -172,8 +172,6 @@ def translator_sec(
|
|
| 172 |
model_load(endpoint2, model2, api_key2, context_window, num_output)
|
| 173 |
except Exception as e:
|
| 174 |
raise gr.Error(f"An unexpected error occurred: {e}")
|
| 175 |
-
|
| 176 |
-
print(init_translation)
|
| 177 |
|
| 178 |
progress((2,3), desc="Reflecton...")
|
| 179 |
reflection = one_chunk_reflect_on_translation(
|
|
|
|
| 162 |
try:
|
| 163 |
language = Language(target_lang)
|
| 164 |
except Exception as e:
|
| 165 |
+
raise gr.Error(f"An unexpected error occurred: {e}")
|
| 166 |
+
init_translation = gtranslator.translate(source_text, language).result
|
| 167 |
else:
|
| 168 |
init_translation = one_chunk_initial_translation(
|
| 169 |
source_lang, target_lang, source_text
|
|
|
|
| 172 |
model_load(endpoint2, model2, api_key2, context_window, num_output)
|
| 173 |
except Exception as e:
|
| 174 |
raise gr.Error(f"An unexpected error occurred: {e}")
|
|
|
|
|
|
|
| 175 |
|
| 176 |
progress((2,3), desc="Reflecton...")
|
| 177 |
reflection = one_chunk_reflect_on_translation(
|