Update app.py
Browse files
app.py
CHANGED
@@ -67,11 +67,22 @@ def download_glove_embeddings_gdrive(model_type):
|
|
67 |
|
68 |
# @st.cache_data()
|
69 |
def load_glove_embeddings_gdrive(model_type):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
word_index_temp = "word_index_dict_" + str(model_type) + "_temp.pkl"
|
71 |
embeddings_temp = "embeddings_" + str(model_type) + "_temp.npy"
|
72 |
|
73 |
# Load word index dictionary
|
74 |
-
|
|
|
75 |
|
76 |
# Load embeddings numpy
|
77 |
embeddings = np.load(embeddings_temp)
|
|
|
67 |
|
68 |
# @st.cache_data()
|
69 |
def load_glove_embeddings_gdrive(model_type):
|
70 |
+
# word_index_temp = "word_index_dict_" + str(model_type) + "_temp.pkl"
|
71 |
+
# embeddings_temp = "embeddings_" + str(model_type) + "_temp.npy"
|
72 |
+
|
73 |
+
# # Load word index dictionary
|
74 |
+
# word_index_dict = pickle.load(open(word_index_temp, "rb"), encoding="latin")
|
75 |
+
|
76 |
+
# # Load embeddings numpy
|
77 |
+
# embeddings = np.load(embeddings_temp)
|
78 |
+
|
79 |
+
# return word_index_dict, embeddings
|
80 |
word_index_temp = "word_index_dict_" + str(model_type) + "_temp.pkl"
|
81 |
embeddings_temp = "embeddings_" + str(model_type) + "_temp.npy"
|
82 |
|
83 |
# Load word index dictionary
|
84 |
+
with open(word_index_temp, "rb") as f:
|
85 |
+
word_index_dict = pickle.load(f, encoding="latin1")
|
86 |
|
87 |
# Load embeddings numpy
|
88 |
embeddings = np.load(embeddings_temp)
|