TiberiuCristianLeon commited on
Commit
57c6dd9
·
verified ·
1 Parent(s): 67377a2
Files changed (1) hide show
  1. app.py +1 -14
app.py CHANGED
@@ -139,7 +139,7 @@ class Translators:
139
  filter(lambda x: x.from_code == from_code and x.to_code == to_code, available_packages)
140
  )
141
  argostranslate.package.install_from_path(package_to_install.download())
142
-
143
  def argos(self):
144
  import argostranslate.translate, argostranslate.package
145
  try:
@@ -485,19 +485,6 @@ class Translators:
485
  response = error
486
  return translated_text, message_text
487
 
488
- def download_argos_model(from_code, to_code):
489
- import argostranslate.package
490
- print('Downloading model', from_code, to_code)
491
- # Download and install Argos Translate package
492
- argostranslate.package.update_package_index()
493
- available_packages = argostranslate.package.get_available_packages()
494
- package_to_install = next(
495
- filter(
496
- lambda x: x.from_code == from_code and x.to_code == to_code, available_packages
497
- )
498
- )
499
- argostranslate.package.install_from_path(package_to_install.download())
500
-
501
  def translate_text(model_name: str, s_language: str, t_language: str, input_text: str) -> tuple[str, str]:
502
  """
503
  Translates the input text from the source language to the target language using a specified model.
 
139
  filter(lambda x: x.from_code == from_code and x.to_code == to_code, available_packages)
140
  )
141
  argostranslate.package.install_from_path(package_to_install.download())
142
+
143
  def argos(self):
144
  import argostranslate.translate, argostranslate.package
145
  try:
 
485
  response = error
486
  return translated_text, message_text
487
 
 
 
 
 
 
 
 
 
 
 
 
 
 
488
  def translate_text(model_name: str, s_language: str, t_language: str, input_text: str) -> tuple[str, str]:
489
  """
490
  Translates the input text from the source language to the target language using a specified model.