Spaces:
Runtime error
Runtime error
mariagrandury
commited on
Commit
•
8cb1dfe
1
Parent(s):
fa5172e
Update application
Browse files
app.py
CHANGED
@@ -30,9 +30,9 @@ MODELS = {
|
|
30 |
PROMPT_LIST = [
|
31 |
"Fui a la librería a comprar un <mask>.",
|
32 |
"¡Qué buen <mask> hace hoy!",
|
33 |
-
"Hoy empiezan las vacaciones
|
34 |
"Mi color favorito es el <mask>.",
|
35 |
-
"Voy a <mask
|
36 |
"Mañana vienen mis amigos de <mask>.",
|
37 |
"¿Te apetece venir a <mask> conmigo?",
|
38 |
"En verano hace mucho <mask>.",
|
@@ -77,25 +77,13 @@ else:
|
|
77 |
text = st.text_area("Enter text", prompt_box)
|
78 |
|
79 |
if st.button("Fill the mask"):
|
80 |
-
with st.spinner(text="
|
81 |
st.subheader("Result")
|
82 |
result = load_model(text, model_url)
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
st.write(
|
88 |
-
f'Please try again in about {result["estimated_time"]:.0f} seconds.'
|
89 |
-
)
|
90 |
-
else:
|
91 |
-
if type(result["error"]) is list:
|
92 |
-
for error in result["error"]:
|
93 |
-
st.write(f"{error}")
|
94 |
-
else:
|
95 |
-
result_sequence, result_token = result[0]["sequence"], result[0]["token_str"]
|
96 |
-
st.write(result_sequence)
|
97 |
-
st.text("English translation")
|
98 |
-
st.write(translate(result_sequence, "en", "es"))
|
99 |
|
100 |
st.markdown(
|
101 |
"""
|
|
|
30 |
PROMPT_LIST = [
|
31 |
"Fui a la librería a comprar un <mask>.",
|
32 |
"¡Qué buen <mask> hace hoy!",
|
33 |
+
"Hoy empiezan las vacaciones así que vamos a la <mask>.",
|
34 |
"Mi color favorito es el <mask>.",
|
35 |
+
"Voy a <mask> porque estoy muy cansada.",
|
36 |
"Mañana vienen mis amigos de <mask>.",
|
37 |
"¿Te apetece venir a <mask> conmigo?",
|
38 |
"En verano hace mucho <mask>.",
|
|
|
77 |
text = st.text_area("Enter text", prompt_box)
|
78 |
|
79 |
if st.button("Fill the mask"):
|
80 |
+
with st.spinner(text="Filling the mask..."):
|
81 |
st.subheader("Result")
|
82 |
result = load_model(text, model_url)
|
83 |
+
result_sequence = result[0]["sequence"]
|
84 |
+
st.write(result_sequence)
|
85 |
+
st.write("_English_ _translation:_", translate(result_sequence, "en", "es"))
|
86 |
+
st.write(result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
st.markdown(
|
89 |
"""
|