Spaces:
Runtime error
Runtime error
Commit
•
0ad09b6
1
Parent(s):
def21a2
Fix MLM translation
Browse files- apps/mlm.py +1 -1
apps/mlm.py
CHANGED
@@ -131,7 +131,7 @@ def app(state):
|
|
131 |
scores = predict(transformed_image, dict(caption_inputs))
|
132 |
scores = softmax(scores)
|
133 |
labels, values = get_top_5_predictions(scores)
|
134 |
-
filled_sentence = mlm_state.caption.replace("[MASK]", labels[
|
135 |
st.write("**Filled Sentence**: " + filled_sentence)
|
136 |
st.write( f"""**English Translation**: {translate(filled_sentence, 'en')}""")
|
137 |
# newer_col1, newer_col2 = st.beta_columns([6,4])
|
|
|
131 |
scores = predict(transformed_image, dict(caption_inputs))
|
132 |
scores = softmax(scores)
|
133 |
labels, values = get_top_5_predictions(scores)
|
134 |
+
filled_sentence = mlm_state.caption.replace("[MASK]", labels[-1])
|
135 |
st.write("**Filled Sentence**: " + filled_sentence)
|
136 |
st.write( f"""**English Translation**: {translate(filled_sentence, 'en')}""")
|
137 |
# newer_col1, newer_col2 = st.beta_columns([6,4])
|