File size: 1,167 Bytes
2065852
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import streamlit as st
import pandas as pd
import pickle

#------------------------------------RAG BASED CHATBOT ---------------------------------------

import sys
import os
sys.path.append(os.path.abspath("src"))

from recommendationSystem.chatbot.client_module.utils import chatbot

# ✅ Redirect model cache and config to writable path
os.environ["HF_HOME"] = "/tmp/huggingface"
os.environ["TRANSFORMERS_CACHE"] = "/tmp/transformers"
os.environ["SENTENCE_TRANSFORMERS_HOME"] = "/tmp/sentence-transformers"

chatbot()
#render_history_download()

#----------------------------------- RECOMMEDATION SYSTEM -----------------------------------------

from utils import fetch_transformed_data, anime_info
 
st.title("Anime Recommender System")

data_path, matrix_path = fetch_transformed_data()

anime_data = pd.read_csv(data_path)
similarity_matrix = pickle.load(open(file=matrix_path,mode='rb'))

select_anime_name = st.selectbox(
    "Choose Anime Name : ",
    anime_data['title'].values,
    index=None,
    placeholder="Select the anime for recommendation..."
)

anime_info(anime_name=select_anime_name,anime_data=anime_data,similarity_matrix=similarity_matrix)