hhval commited on
Commit
b4cfde3
·
verified ·
1 Parent(s): 1bfcd25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -6,9 +6,15 @@ import yaml
6
  import json
7
  from googletrans import Translator
8
  from tools.final_answer import FinalAnswerTool
 
9
 
10
  from Gradio_UI import GradioUI
11
 
 
 
 
 
 
12
  @tool
13
  def translate_to_norwegian(text: str) -> str:
14
  """A tool that translates the input text to Norwegian using Google Translate.
 
6
  import json
7
  from googletrans import Translator
8
  from tools.final_answer import FinalAnswerTool
9
+ import subprocess
10
 
11
  from Gradio_UI import GradioUI
12
 
13
+ try:
14
+ subprocess.run(["pip", "install", "googletrans==4.0.0-rc1"], check=True)
15
+ except subprocess.CalledProcessError:
16
+ print("Failed to install googletrans.")
17
+
18
  @tool
19
  def translate_to_norwegian(text: str) -> str:
20
  """A tool that translates the input text to Norwegian using Google Translate.