gaspar-avit commited on
Commit
2074242
·
1 Parent(s): f243b69

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -190,11 +190,13 @@ def query_generate(text):
190
 
191
  response = requests.post(API_URL, headers=headers, json=payload)
192
 
 
193
  if 'error' in response.content.decode("utf-8"):
194
  payload = {"inputs": f"{text}",
195
  "options": {"wait_for_model": True},
196
  }
197
  response = requests.post(API_URL, headers=headers, json=payload)
 
198
 
199
  return response.content
200
 
@@ -216,8 +218,8 @@ def generate_poster(movie_data):
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
 
@@ -238,8 +240,8 @@ def generate_poster(movie_data):
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
 
190
 
191
  response = requests.post(API_URL, headers=headers, json=payload)
192
 
193
+ _="""
194
  if 'error' in response.content.decode("utf-8"):
195
  payload = {"inputs": f"{text}",
196
  "options": {"wait_for_model": True},
197
  }
198
  response = requests.post(API_URL, headers=headers, json=payload)
199
+ """
200
 
201
  return response.content
202
 
 
218
  synopsis_expander = st.expander("Show synopsis", expanded=True)
219
  with synopsis_expander:
220
  st.subheader("Summarized synopsis:")
221
+ col1, col2 = st.columns([5, 1])
222
+ with col1:
223
  st.write(synopsis_sum)
224
  st.text("")
225
 
 
240
  st.image(image, caption="Movie: \"" + movie_data.title.values[0] + "\"")
241
 
242
  except:
243
+ col1, col2 = st.columns([5, 1])
244
+ with col1:
245
  st.write(response_content)
246
 
247
  return response_content