Spaces:
Runtime error
Runtime error
Commit
·
ea99da5
1
Parent(s):
821f153
Change layout
Browse files
app.py
CHANGED
|
@@ -104,8 +104,8 @@ if state.image_file is None:
|
|
| 104 |
state.image = image
|
| 105 |
|
| 106 |
# col1, col2 = st.beta_columns([6, 4])
|
| 107 |
-
|
| 108 |
-
if
|
| 109 |
"Get a random example",
|
| 110 |
help="Get a random example from the 100 `seeded` image-text pairs.",
|
| 111 |
):
|
|
@@ -133,17 +133,19 @@ if st.button(
|
|
| 133 |
|
| 134 |
transformed_image = get_transformed_image(state.image)
|
| 135 |
|
|
|
|
|
|
|
| 136 |
# Display Image
|
| 137 |
-
|
|
|
|
| 138 |
|
| 139 |
-
new_col1, new_col2 = st.beta_columns([5, 5])
|
| 140 |
# Display Question
|
| 141 |
-
question =
|
| 142 |
label="Question",
|
| 143 |
value=state.question,
|
| 144 |
help="Type your question regarding the image above in one of the four languages.",
|
| 145 |
)
|
| 146 |
-
|
| 147 |
f"""**English Translation**: {question if state.question_lang_id == "en" else translate(question, 'en')}"""
|
| 148 |
)
|
| 149 |
|
|
|
|
| 104 |
state.image = image
|
| 105 |
|
| 106 |
# col1, col2 = st.beta_columns([6, 4])
|
| 107 |
+
new_col1, new_col2 = st.beta_columns([5, 5])
|
| 108 |
+
if new_col1.button(
|
| 109 |
"Get a random example",
|
| 110 |
help="Get a random example from the 100 `seeded` image-text pairs.",
|
| 111 |
):
|
|
|
|
| 133 |
|
| 134 |
transformed_image = get_transformed_image(state.image)
|
| 135 |
|
| 136 |
+
|
| 137 |
+
|
| 138 |
# Display Image
|
| 139 |
+
new_col1.image(state.image, use_column_width="auto")
|
| 140 |
+
|
| 141 |
|
|
|
|
| 142 |
# Display Question
|
| 143 |
+
question = new_col2.text_input(
|
| 144 |
label="Question",
|
| 145 |
value=state.question,
|
| 146 |
help="Type your question regarding the image above in one of the four languages.",
|
| 147 |
)
|
| 148 |
+
new_col2.markdown(
|
| 149 |
f"""**English Translation**: {question if state.question_lang_id == "en" else translate(question, 'en')}"""
|
| 150 |
)
|
| 151 |
|