gaspar-avit commited on
Commit
233b641
1 Parent(s): 80e9647

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -9
app.py CHANGED
@@ -1,12 +1,7 @@
1
  ## Alternative movie poster generator
2
 
3
 
4
- # Install newer version of streamlit
5
- import subprocess
6
- import sys
7
- subprocess.check_call([sys.executable, "-m", "pip", "install", "streamlit==1.19.0"])
8
-
9
- import streamlit as st; print(st.__version__)
10
  import pandas as pd
11
  import numpy as np
12
  import json
@@ -127,7 +122,7 @@ def authenticate_kaggle():
127
  api.authenticate()
128
 
129
 
130
- @st.experimental_memo(persist=True, show_spinner=False, suppress_st_warning=True)
131
  def load_dataset():
132
  """
133
  Load Dataset from Kaggle
@@ -196,7 +191,7 @@ def query_generate(text):
196
  response = requests.post(API_URL, headers=headers, json=payload)
197
  return response.content
198
 
199
- #@st.cache_data
200
  def generate_poster(movie_data):
201
  """
202
  Function for recommending movies
@@ -293,7 +288,7 @@ if __name__ == "__main__":
293
 
294
  if is_clicked:
295
  poster = generate_poster(data[data.title_year==selected_movie])
296
- #st.cache_data.clear()
297
 
298
 
299
  _= """
 
1
  ## Alternative movie poster generator
2
 
3
 
4
+ import streamlit as st
 
 
 
 
 
5
  import pandas as pd
6
  import numpy as np
7
  import json
 
122
  api.authenticate()
123
 
124
 
125
+ @st.experimental_memo(persist=True, show_spinner=False, suppress_st_warning=True, max_entries=1)
126
  def load_dataset():
127
  """
128
  Load Dataset from Kaggle
 
191
  response = requests.post(API_URL, headers=headers, json=payload)
192
  return response.content
193
 
194
+ @st.experimental_memo(persist=False, show_spinner=False, suppress_st_warning=True)
195
  def generate_poster(movie_data):
196
  """
197
  Function for recommending movies
 
288
 
289
  if is_clicked:
290
  poster = generate_poster(data[data.title_year==selected_movie])
291
+ generate_poster.clear()
292
 
293
 
294
  _= """