tes
Browse files- recommendwithhist.py +2 -2
recommendwithhist.py
CHANGED
@@ -22,13 +22,13 @@ def stemmed_tokenizer(text):
|
|
22 |
user_history = {}
|
23 |
# Function to save user history to a pickle file
|
24 |
def save_user_history():
|
25 |
-
with open('user_history.pkl', 'wb') as file:
|
26 |
pickle.dump(user_history, file)
|
27 |
|
28 |
# Function to load user history from a pickle file
|
29 |
def load_user_history():
|
30 |
global user_history
|
31 |
-
if os.path.exists('user_history.pkl'):
|
32 |
with open('user_history.pkl', 'rb') as file:
|
33 |
user_history = pickle.load(file)
|
34 |
|
|
|
22 |
user_history = {}
|
23 |
# Function to save user history to a pickle file
|
24 |
def save_user_history():
|
25 |
+
with open(cache_dir+'user_history.pkl', 'wb') as file:
|
26 |
pickle.dump(user_history, file)
|
27 |
|
28 |
# Function to load user history from a pickle file
|
29 |
def load_user_history():
|
30 |
global user_history
|
31 |
+
if os.path.exists(cache_dir+'user_history.pkl'):
|
32 |
with open('user_history.pkl', 'rb') as file:
|
33 |
user_history = pickle.load(file)
|
34 |
|