gaspar-avit commited on
Commit
65ccb73
·
1 Parent(s): 91fa72d

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +9 -7
  2. requirements.txt +2 -1
app.py CHANGED
@@ -185,6 +185,9 @@ def generate_poster(movie_data):
185
  # Get summarization of movie synopsis
186
  with st.spinner("Please wait while the synopsis is being summarized..."):
187
  synopsis_sum = query_summarization(movie_data.overview.values[0])
 
 
 
188
  st.text(synopsis_sum)
189
 
190
  # Load text-to-image model
@@ -193,12 +196,11 @@ def generate_poster(movie_data):
193
  pipeline = load_model()
194
 
195
  # Get image based on synopsis
196
- image = pipeline(prompt).images[0]
197
- st.image(image, caption=movie_data.title)
198
-
199
- return None #poster_image
200
-
201
 
 
 
202
 
203
 
204
  ###############################
@@ -251,5 +253,5 @@ if __name__ == "__main__":
251
  st.text("")
252
  st.text("")
253
 
254
- #if image is not None:
255
- # st.image(image, caption=session.selected_movie.title.values[0])
 
185
  # Get summarization of movie synopsis
186
  with st.spinner("Please wait while the synopsis is being summarized..."):
187
  synopsis_sum = query_summarization(movie_data.overview.values[0])
188
+
189
+ st.text("")
190
+ st.text("")
191
  st.text(synopsis_sum)
192
 
193
  # Load text-to-image model
 
196
  pipeline = load_model()
197
 
198
  # Get image based on synopsis
199
+ poster_image = pipeline(synopsis_sum).images[0]
200
+ st.image(poster_image, caption=movie_data.title)
 
 
 
201
 
202
+ return poster_image
203
+ # ------------------------------------------------------- #
204
 
205
 
206
  ###############################
 
253
  st.text("")
254
  st.text("")
255
 
256
+ if image is not None:
257
+ st.image(image, caption=session.selected_movie.title.values[0])
requirements.txt CHANGED
@@ -3,4 +3,5 @@ kaggle
3
  zipfile39
4
  sentence-transformers
5
  diffusers
6
- accelerate
 
 
3
  zipfile39
4
  sentence-transformers
5
  diffusers
6
+ accelerate
7
+ htbuilder