Changes by madisonowens
Browse files-add translation on app.py
- app.py +2 -0
- translation.py +0 -2
app.py
CHANGED
@@ -11,10 +11,12 @@ import os
|
|
11 |
st.write('Part 1')
|
12 |
|
13 |
question = st.text_input('Posez votre question')
|
|
|
14 |
url = st.text_input('mettez le liens de votre image')
|
15 |
|
16 |
if st.button('générer'):
|
17 |
responseBase = image(url, question)
|
|
|
18 |
st.write('response is :', responseBase)
|
19 |
|
20 |
st.write('Part 2')
|
|
|
11 |
st.write('Part 1')
|
12 |
|
13 |
question = st.text_input('Posez votre question')
|
14 |
+
question = frenchtoenglish(question)
|
15 |
url = st.text_input('mettez le liens de votre image')
|
16 |
|
17 |
if st.button('générer'):
|
18 |
responseBase = image(url, question)
|
19 |
+
responseBase = englishtofrench(responseBase)
|
20 |
st.write('response is :', responseBase)
|
21 |
|
22 |
st.write('Part 2')
|
translation.py
CHANGED
@@ -20,9 +20,7 @@ def englishtofrench(input):
|
|
20 |
generated_tokens = model.generate(**encoded_en, forced_bos_token_id=tokenizer.get_lang_id("fr"))
|
21 |
return tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
22 |
|
23 |
-
|
24 |
### VOICI LES 2 FONCTIONS QUE TU AVAIS FAITES AVANT MAIS QUE J'AI DU REFAIRE
|
25 |
|
26 |
-
|
27 |
print(frenchtoenglish(fr_text))
|
28 |
print(englishtofrench(en_text))
|
|
|
20 |
generated_tokens = model.generate(**encoded_en, forced_bos_token_id=tokenizer.get_lang_id("fr"))
|
21 |
return tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)
|
22 |
|
|
|
23 |
### VOICI LES 2 FONCTIONS QUE TU AVAIS FAITES AVANT MAIS QUE J'AI DU REFAIRE
|
24 |
|
|
|
25 |
print(frenchtoenglish(fr_text))
|
26 |
print(englishtofrench(en_text))
|