laudavid commited on
Commit
c548d40
1 Parent(s): 8c92d2a

fix page layout + poster recom movie

Browse files
main_page.py CHANGED
@@ -83,5 +83,5 @@ show_pages(
83
  ##################################################################################
84
 
85
 
86
-
87
 
 
83
  ##################################################################################
84
 
85
 
86
+ st.experimental_rerun()
87
 
pages/object_detection.py CHANGED
@@ -14,7 +14,7 @@ from torchvision.transforms import ToTensor, ToPILImage
14
  from annotated_text import annotated_text
15
 
16
 
17
- #st.set_page_config(layout="wide")
18
 
19
  @st.cache_data(ttl=3600, show_spinner=False)
20
  def load_model(feature_extractor_url, model_url):
 
14
  from annotated_text import annotated_text
15
 
16
 
17
+ st.set_page_config(layout="wide")
18
 
19
  @st.cache_data(ttl=3600, show_spinner=False)
20
  def load_model(feature_extractor_url, model_url):
pages/recommendation_system.py CHANGED
@@ -13,8 +13,7 @@ from utils import load_data_pickle, load_model_pickle, load_data_csv
13
 
14
 
15
 
16
- #st.set_page_config(layout="wide")
17
-
18
 
19
 
20
  st.markdown("# Recommendation system")
@@ -83,11 +82,11 @@ def recommend(movie_name, nb):
83
  recommend_posters.append(poster)
84
 
85
  # fetch poster
86
- # try:
87
- # poster = fetch_poster(temp_movie_id)
88
- # recommend_posters.append(poster)
89
- # except:
90
- # recommend_posters.append(None)
91
 
92
  recommend_movies_names.append(i)
93
  return recommend_movies_names, recommend_posters, movie_ids
@@ -96,6 +95,7 @@ def recommend(movie_name, nb):
96
  def fetch_poster(movie_id):
97
  response = requests.get(f'https://api.themoviedb.org/3/movie/{movie_id}?api_key={api_key}')
98
  data = response.json()
 
99
  return "https://image.tmdb.org/t/p/w500/" + data["poster_path"]
100
 
101
 
 
13
 
14
 
15
 
16
+ st.set_page_config(layout="wide")
 
17
 
18
 
19
  st.markdown("# Recommendation system")
 
82
  recommend_posters.append(poster)
83
 
84
  # fetch poster
85
+ try:
86
+ poster = fetch_poster(temp_movie_id)
87
+ recommend_posters.append(poster)
88
+ except:
89
+ recommend_posters.append(None)
90
 
91
  recommend_movies_names.append(i)
92
  return recommend_movies_names, recommend_posters, movie_ids
 
95
  def fetch_poster(movie_id):
96
  response = requests.get(f'https://api.themoviedb.org/3/movie/{movie_id}?api_key={api_key}')
97
  data = response.json()
98
+ st.markdown(data)
99
  return "https://image.tmdb.org/t/p/w500/" + data["poster_path"]
100
 
101
 
pages/sentiment_analysis.py CHANGED
@@ -11,7 +11,7 @@ import plotly.express as px
11
  from pysentimiento import create_analyzer
12
  from utils import load_data_pickle
13
 
14
- #st.set_page_config(layout="wide")
15
 
16
  def clean_text(text):
17
  pattern_punct = r"[^\w\s.',:/]"
 
11
  from pysentimiento import create_analyzer
12
  from utils import load_data_pickle
13
 
14
+ st.set_page_config(layout="wide")
15
 
16
  def clean_text(text):
17
  pattern_punct = r"[^\w\s.',:/]"
pages/supervised_unsupervised_page.py CHANGED
@@ -12,7 +12,7 @@ from annotated_text import annotated_text
12
  # PAGE CONFIG
13
  #####################################################################################
14
 
15
- #st.set_page_config(layout="wide")
16
 
17
 
18
 
 
12
  # PAGE CONFIG
13
  #####################################################################################
14
 
15
+ st.set_page_config(layout="wide")
16
 
17
 
18
 
pages/timeseries_analysis.py CHANGED
@@ -11,7 +11,7 @@ from utils import load_data_pickle
11
  from sklearn.metrics import root_mean_squared_error
12
 
13
 
14
- #st.set_page_config(layout="wide")
15
 
16
  @st.cache_data(ttl=3600, show_spinner=False)
17
  def forecast_prophet(train, test, col=None):
 
11
  from sklearn.metrics import root_mean_squared_error
12
 
13
 
14
+ st.set_page_config(layout="wide")
15
 
16
  @st.cache_data(ttl=3600, show_spinner=False)
17
  def forecast_prophet(train, test, col=None):