TiberiuCristianLeon commited on
Commit
cd2dcf6
·
verified ·
1 Parent(s): 44f3be7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -43,7 +43,10 @@ translated_textarea = st.text("")
43
 
44
  # Handle the submit button click
45
  if submit_button:
46
- prompt = f'translate {sselected_language} to {tselected_language}: {input_text}'
 
 
 
47
  print(prompt)
48
  input_ids = tokenizer.encode(prompt, return_tensors='pt')
49
  # Perform translation
 
43
 
44
  # Handle the submit button click
45
  if submit_button:
46
+ if model_name.startswith('Helsinki-NLP'):
47
+ prompt = input_text
48
+ else:
49
+ prompt = f'translate {sselected_language} to {tselected_language}: {input_text}'
50
  print(prompt)
51
  input_ids = tokenizer.encode(prompt, return_tensors='pt')
52
  # Perform translation