Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,11 +57,11 @@ elif selected == 'Translate':
|
|
| 57 |
return response.json()
|
| 58 |
output = query_spanish({"inputs": text_in})
|
| 59 |
if not output[0]["translation_text"]:
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
|
| 66 |
# text_out_spanish = col4.markdown('''<br/> <p style='text-align:left;font-size:16px;'>'''+ output_spanish[0] ["translation_text"] +'''</p>''', unsafe_allow_html=True)
|
| 67 |
st.info(":blue[Please feel fit to like it after use! 😉🙏]")
|
|
|
|
| 57 |
return response.json()
|
| 58 |
output = query_spanish({"inputs": text_in})
|
| 59 |
if not output[0]["translation_text"]:
|
| 60 |
+
error_message = output[0]["error"]
|
| 61 |
+
st.error(f"Le texte n'a pas pu être traduit: {error_message}")
|
| 62 |
+
else:
|
| 63 |
+
translated_text = output[0]["translation_text"]
|
| 64 |
+
col5.markdown('''<br/> <p style='text-align:left;font-size:16px;'>'''+ translated_text +'''</p>''', unsafe_allow_html=True)
|
| 65 |
|
| 66 |
# text_out_spanish = col4.markdown('''<br/> <p style='text-align:left;font-size:16px;'>'''+ output_spanish[0] ["translation_text"] +'''</p>''', unsafe_allow_html=True)
|
| 67 |
st.info(":blue[Please feel fit to like it after use! 😉🙏]")
|