Spaces:
Runtime error
Runtime error
gaspar-avit
commited on
Commit
·
f901d19
1
Parent(s):
b360200
Upload app.py
Browse files
app.py
CHANGED
@@ -219,20 +219,22 @@ def generate_poster(movie_data):
|
|
219 |
st.text("")
|
220 |
st.text("Synopsis summary: " + synopsis_sum)
|
221 |
|
222 |
-
|
223 |
-
|
224 |
-
with st.spinner("
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
#
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
|
|
|
|
236 |
st.image(poster_image, caption=movie_data.title)
|
237 |
|
238 |
return poster_image
|
@@ -292,4 +294,4 @@ if __name__ == "__main__":
|
|
292 |
st.text("")
|
293 |
|
294 |
if image is not None:
|
295 |
-
st.image(image, caption=session.selected_movie.title
|
|
|
219 |
st.text("")
|
220 |
st.text("Synopsis summary: " + synopsis_sum)
|
221 |
|
222 |
+
if 1:
|
223 |
+
# Get image based on synopsis
|
224 |
+
with st.spinner("Generating poster image...\nThis may take some time, please be patient"):
|
225 |
+
#poster_image = pipeline(synopsis_sum).images[0]
|
226 |
+
poster_image = query_gen(synopsis_sum)
|
227 |
+
|
228 |
+
else:
|
229 |
+
# Load text-to-image model
|
230 |
+
if not IS_MODEL_LOADED:
|
231 |
+
with st.spinner("Loading Text to Image model..."):
|
232 |
+
pipeline = load_model()
|
233 |
+
|
234 |
+
# Get image based on synopsis
|
235 |
+
with st.spinner("Generating poster image...\nThis may take some time, please be patient"):
|
236 |
+
poster_image = pipeline(synopsis_sum).images[0]
|
237 |
+
|
238 |
st.image(poster_image, caption=movie_data.title)
|
239 |
|
240 |
return poster_image
|
|
|
294 |
st.text("")
|
295 |
|
296 |
if image is not None:
|
297 |
+
st.image(image, caption=session.selected_movie.title)
|