Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ translated_textarea = st.text("")
|
|
37 |
|
38 |
# Handle the submit button click
|
39 |
if submit_button:
|
40 |
-
prompt = f'
|
41 |
print(prompt)
|
42 |
input_ids = tokenizer.encode(prompt, return_tensors='pt')
|
43 |
# Perform translation
|
@@ -46,5 +46,5 @@ if submit_button:
|
|
46 |
translated_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
47 |
# Display the translated text
|
48 |
print(translated_text)
|
49 |
-
st.write(f"Translated text from {sselected_language} to {tselected_language}:
|
50 |
translated_textarea = st.text(translated_text)
|
|
|
37 |
|
38 |
# Handle the submit button click
|
39 |
if submit_button:
|
40 |
+
prompt = f'translate {sselected_language} to {tselected_language}: {input_text}'
|
41 |
print(prompt)
|
42 |
input_ids = tokenizer.encode(prompt, return_tensors='pt')
|
43 |
# Perform translation
|
|
|
46 |
translated_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
47 |
# Display the translated text
|
48 |
print(translated_text)
|
49 |
+
st.write(f"Translated text from {sselected_language} to {tselected_language} using {model_name}:)
|
50 |
translated_textarea = st.text(translated_text)
|