TiberiuCristianLeon commited on
Commit
8f1fed8
·
verified ·
1 Parent(s): 7716bf5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -28,13 +28,13 @@ if submit_button:
28
  # Encode the input text
29
  # encoded = tokenizer(text_input, return_tensors="pt")
30
 
31
- input_ids = tokenizer.encode(f'Translate {sselected_language} to {tselected_language}: {input_text}', return_tensors='pt')
32
 
33
  # Perform translation
34
  output_ids = model.generate(input_ids)
35
 
36
  # Decode the translated text
37
- translated_text = tokenizer.decode(output_ids, skip_special_tokens=True)
38
 
39
  # Display the translated text
40
  st.write("Translated Text:", translated_text)
 
28
  # Encode the input text
29
  # encoded = tokenizer(text_input, return_tensors="pt")
30
 
31
+ input_ids = tokenizer.encode(f'translate {sselected_language} to {tselected_language}: {input_text}', return_tensors='pt')
32
 
33
  # Perform translation
34
  output_ids = model.generate(input_ids)
35
 
36
  # Decode the translated text
37
+ translated_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
38
 
39
  # Display the translated text
40
  st.write("Translated Text:", translated_text)