UnarineLeo
commited on
Commit
•
edebde4
1
Parent(s):
ffffb96
Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ if 'warnings' not in st.session_state:
|
|
34 |
st.session_state['warnings'] = []
|
35 |
|
36 |
with col1:
|
37 |
-
with st.container(
|
38 |
st.markdown("Input :clipboard:")
|
39 |
sample_sentence = {
|
40 |
'zulu': "Le ndoda ithi izo <mask> ukudla.",
|
@@ -54,13 +54,13 @@ with col1:
|
|
54 |
button1, button2, _ = st.columns([2, 2, 4])
|
55 |
with button1:
|
56 |
if st.button("Test Example"):
|
|
|
57 |
st.session_state['text_input'] = "\n".join([f"{lang}: {sentence}" for lang, sentence in sample_sentence.items()])
|
58 |
-
st.experimental_rerun() # Rerun to update the text_area with example sentences
|
59 |
|
60 |
with button2:
|
61 |
if st.button("Submit"):
|
62 |
result, warnings = fill_mask(input_sentences)
|
63 |
-
st.session_state['warnings'] = warnings
|
64 |
|
65 |
if st.session_state['warnings']:
|
66 |
for warning in st.session_state['warnings']:
|
@@ -70,7 +70,7 @@ with col1:
|
|
70 |
st.code(sample_sentence, wrap_lines=True)
|
71 |
|
72 |
with col2:
|
73 |
-
with st.container(
|
74 |
st.markdown("Output :bar_chart:")
|
75 |
if input_sentences:
|
76 |
for language, sentence in input_sentences.items():
|
|
|
34 |
st.session_state['warnings'] = []
|
35 |
|
36 |
with col1:
|
37 |
+
with st.container(border=True):
|
38 |
st.markdown("Input :clipboard:")
|
39 |
sample_sentence = {
|
40 |
'zulu': "Le ndoda ithi izo <mask> ukudla.",
|
|
|
54 |
button1, button2, _ = st.columns([2, 2, 4])
|
55 |
with button1:
|
56 |
if st.button("Test Example"):
|
57 |
+
result, warnings = fill_mask("\n".join([f"{lang}: {sentence}" for lang, sentence in sample_sentence.items()]))
|
58 |
st.session_state['text_input'] = "\n".join([f"{lang}: {sentence}" for lang, sentence in sample_sentence.items()])
|
|
|
59 |
|
60 |
with button2:
|
61 |
if st.button("Submit"):
|
62 |
result, warnings = fill_mask(input_sentences)
|
63 |
+
st.session_state['warnings'] = warnings
|
64 |
|
65 |
if st.session_state['warnings']:
|
66 |
for warning in st.session_state['warnings']:
|
|
|
70 |
st.code(sample_sentence, wrap_lines=True)
|
71 |
|
72 |
with col2:
|
73 |
+
with st.container(border=True):
|
74 |
st.markdown("Output :bar_chart:")
|
75 |
if input_sentences:
|
76 |
for language, sentence in input_sentences.items():
|