Aytaj commited on
Commit
a2ac978
·
1 Parent(s): 13ee0fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -2,11 +2,10 @@
2
  import streamlit as st
3
  from transformers import pipeline
4
 
5
- def main():
6
- st.title("Translate to French")
7
- sentence = st.text_input("Enter your sentence:")
8
- if st.button("Translate"):
9
- pipe = pipeline(model="facebook/m2m100_418M")
10
- translation = pipe(sentence, target_lang="fr")[0]["translation_text"]
11
- st.write(translation)
12
 
 
2
  import streamlit as st
3
  from transformers import pipeline
4
 
5
+ st.title("Translate to French")
6
+ sentence = st.text_input("Enter your sentence:")
7
+ if st.button("Translate"):
8
+ pipe = pipeline(model="facebook/m2m100_418M")
9
+ translation = pipe(sentence, target_lang="fr")[0]["translation_text"]
10
+ st.write(translation)
 
11