vilarin commited on
Commit
7a5d2e7
·
verified ·
1 Parent(s): bd7a400

Update app/webui/process.py

Browse files
Files changed (1) hide show
  1. app/webui/process.py +4 -3
app/webui/process.py CHANGED
@@ -163,8 +163,7 @@ def translator_sec(
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, target_lang)
167
- print(init_translation)
168
  else:
169
  init_translation = one_chunk_initial_translation(
170
  source_lang, target_lang, source_text
@@ -174,6 +173,8 @@ def translator_sec(
174
  except Exception as e:
175
  raise gr.Error(f"An unexpected error occurred: {e}")
176
 
 
 
177
  progress((2,3), desc="Reflecton...")
178
  reflection = one_chunk_reflect_on_translation(
179
  source_lang, target_lang, source_text, init_translation, country
@@ -210,7 +211,7 @@ def translator_sec(
210
  language = Language(target_lang)
211
  except Exception as e:
212
  raise gr.Error(f"An unexpected error occurred: {e}")
213
- translation_1_chunks = gtranslator.translate(source_text_chunks, target_lang)
214
  else:
215
  translation_1_chunks = multichunk_initial_translation(
216
  source_lang, target_lang, source_text_chunks
 
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
 
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(
180
  source_lang, target_lang, source_text, init_translation, country
 
211
  language = Language(target_lang)
212
  except Exception as e:
213
  raise gr.Error(f"An unexpected error occurred: {e}")
214
+ translation_1_chunks = gtranslator.translate(source_text_chunks, language)
215
  else:
216
  translation_1_chunks = multichunk_initial_translation(
217
  source_lang, target_lang, source_text_chunks