Spaces:
Runtime error
Runtime error
Commit
·
f243b69
1
Parent(s):
af93059
Upload app.py
Browse files
app.py
CHANGED
@@ -213,22 +213,22 @@ def generate_poster(movie_data):
|
|
213 |
|
214 |
# Print summarized synopsis
|
215 |
st.text("")
|
216 |
-
synopsis_expander = st.expander("
|
217 |
with synopsis_expander:
|
218 |
st.subheader("Summarized synopsis:")
|
219 |
col1, col2, col3 = st.columns([1, 5, 1])
|
220 |
with col2:
|
221 |
-
st.
|
222 |
st.text("")
|
223 |
|
224 |
|
225 |
# Get image based on synopsis
|
226 |
with st.spinner("Generating poster image..."):
|
227 |
-
|
228 |
|
229 |
# Show image
|
230 |
try:
|
231 |
-
image = Image.open(io.BytesIO(
|
232 |
|
233 |
st.text("")
|
234 |
st.text("")
|
@@ -238,9 +238,11 @@ def generate_poster(movie_data):
|
|
238 |
st.image(image, caption="Movie: \"" + movie_data.title.values[0] + "\"")
|
239 |
|
240 |
except:
|
241 |
-
st.
|
|
|
|
|
242 |
|
243 |
-
return
|
244 |
# ------------------------------------------------------- #
|
245 |
|
246 |
|
|
|
213 |
|
214 |
# Print summarized synopsis
|
215 |
st.text("")
|
216 |
+
synopsis_expander = st.expander("Show synopsis", expanded=True)
|
217 |
with synopsis_expander:
|
218 |
st.subheader("Summarized synopsis:")
|
219 |
col1, col2, col3 = st.columns([1, 5, 1])
|
220 |
with col2:
|
221 |
+
st.write(synopsis_sum)
|
222 |
st.text("")
|
223 |
|
224 |
|
225 |
# Get image based on synopsis
|
226 |
with st.spinner("Generating poster image..."):
|
227 |
+
response_content = query_generate(synopsis_sum)
|
228 |
|
229 |
# Show image
|
230 |
try:
|
231 |
+
image = Image.open(io.BytesIO(response_content))
|
232 |
|
233 |
st.text("")
|
234 |
st.text("")
|
|
|
238 |
st.image(image, caption="Movie: \"" + movie_data.title.values[0] + "\"")
|
239 |
|
240 |
except:
|
241 |
+
col1, col2, col3 = st.columns([1, 5, 1])
|
242 |
+
with col2:
|
243 |
+
st.write(response_content)
|
244 |
|
245 |
+
return response_content
|
246 |
# ------------------------------------------------------- #
|
247 |
|
248 |
|