zenith04 commited on
Commit
2065852
·
verified ·
1 Parent(s): 7143f0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -34
app.py CHANGED
@@ -1,34 +1,39 @@
1
- import streamlit as st
2
- import pandas as pd
3
- import pickle
4
-
5
- #------------------------------------RAG BASED CHATBOT ---------------------------------------
6
-
7
- import sys
8
- import os
9
- sys.path.append(os.path.abspath("src"))
10
-
11
- from recommendationSystem.chatbot.client_module.utils import chatbot
12
-
13
- chatbot()
14
- #render_history_download()
15
-
16
- #----------------------------------- RECOMMEDATION SYSTEM -----------------------------------------
17
-
18
- from utils import fetch_transformed_data, anime_info
19
-
20
- st.title("Anime Recommender System")
21
-
22
- data_path, matrix_path = fetch_transformed_data()
23
-
24
- anime_data = pd.read_csv(data_path)
25
- similarity_matrix = pickle.load(open(file=matrix_path,mode='rb'))
26
-
27
- select_anime_name = st.selectbox(
28
- "Choose Anime Name : ",
29
- anime_data['title'].values,
30
- index=None,
31
- placeholder="Select the anime for recommendation..."
32
- )
33
-
34
- anime_info(anime_name=select_anime_name,anime_data=anime_data,similarity_matrix=similarity_matrix)
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import pickle
4
+
5
+ #------------------------------------RAG BASED CHATBOT ---------------------------------------
6
+
7
+ import sys
8
+ import os
9
+ sys.path.append(os.path.abspath("src"))
10
+
11
+ from recommendationSystem.chatbot.client_module.utils import chatbot
12
+
13
+ # ✅ Redirect model cache and config to writable path
14
+ os.environ["HF_HOME"] = "/tmp/huggingface"
15
+ os.environ["TRANSFORMERS_CACHE"] = "/tmp/transformers"
16
+ os.environ["SENTENCE_TRANSFORMERS_HOME"] = "/tmp/sentence-transformers"
17
+
18
+ chatbot()
19
+ #render_history_download()
20
+
21
+ #----------------------------------- RECOMMEDATION SYSTEM -----------------------------------------
22
+
23
+ from utils import fetch_transformed_data, anime_info
24
+
25
+ st.title("Anime Recommender System")
26
+
27
+ data_path, matrix_path = fetch_transformed_data()
28
+
29
+ anime_data = pd.read_csv(data_path)
30
+ similarity_matrix = pickle.load(open(file=matrix_path,mode='rb'))
31
+
32
+ select_anime_name = st.selectbox(
33
+ "Choose Anime Name : ",
34
+ anime_data['title'].values,
35
+ index=None,
36
+ placeholder="Select the anime for recommendation..."
37
+ )
38
+
39
+ anime_info(anime_name=select_anime_name,anime_data=anime_data,similarity_matrix=similarity_matrix)