TiberiuCristianLeon commited on
Commit
30f984e
·
verified ·
1 Parent(s): 37f2f40

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -7,7 +7,7 @@ import os
7
  st.header("Text Machine Translation")
8
  input_text = st.text_input("Enter text to translate:")
9
  # Create a list of options for the select box
10
- options = ["German", "Romanian", "English", "French", "Spanish"]
11
  langs = {"English":"en", "Romanian":"ro", "German":"de", "French":"fr", "Spanish":"es", "Italian":"it"}
12
  models = ["Helsinki-NLP", "t5-base", "t5-small", "t5-large", "Unbabel/TowerInstruct-7B-v0.2", "Unbabel/TowerInstruct-Mistral-7B-v0.2", 'Google']
13
 
@@ -57,7 +57,7 @@ if submit_button:
57
  elif model_name.startswith('Google'):
58
  import requests
59
  url = os.environ['GTRANSURL']
60
- params = {'client': 'gtx', 'sl': sselected_language, 'tl': tselected_language, 'dt': 't', 'ie': 'UTF-8', 'oe': 'UTF-8', 'q': input_text}
61
  response = requests.get(url, params=params)
62
  translated_text = response.json()[0][0][0]
63
  print(response.url, response.json()[0][0])
 
7
  st.header("Text Machine Translation")
8
  input_text = st.text_input("Enter text to translate:")
9
  # Create a list of options for the select box
10
+ options = ["German", "Romanian", "English", "French", "Spanish", "Italian"]
11
  langs = {"English":"en", "Romanian":"ro", "German":"de", "French":"fr", "Spanish":"es", "Italian":"it"}
12
  models = ["Helsinki-NLP", "t5-base", "t5-small", "t5-large", "Unbabel/TowerInstruct-7B-v0.2", "Unbabel/TowerInstruct-Mistral-7B-v0.2", 'Google']
13
 
 
57
  elif model_name.startswith('Google'):
58
  import requests
59
  url = os.environ['GTRANSURL']
60
+ params = {'client': 'gtx', 'sl': sl, 'tl': tl, 'dt': 't', 'ie': 'UTF-8', 'oe': 'UTF-8', 'q': input_text}
61
  response = requests.get(url, params=params)
62
  translated_text = response.json()[0][0][0]
63
  print(response.url, response.json()[0][0])