Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,15 @@ from pathlib import Path
|
|
7 |
import time
|
8 |
|
9 |
model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
# Define the function to categorize ages
|
12 |
def categorize_source(source):
|
@@ -37,14 +46,6 @@ def find(query):
|
|
37 |
print("start")
|
38 |
print(time.time())
|
39 |
|
40 |
-
hadiths = pd.read_csv('all_hadiths_clean.csv', delimiter=",")
|
41 |
-
|
42 |
-
document_embeddings = torch.load('encoded_hadiths_multilingual-e5-large-instruct (1).sav',map_location ='cpu')
|
43 |
-
#file = open('encoded_hadiths_multilingual-e5-large-instruct (1).sav','rb')
|
44 |
-
#document_embeddings = pickle.load(file)
|
45 |
-
print("load hadiths")
|
46 |
-
print(time.time())
|
47 |
-
|
48 |
query_embeddings = model.encode(queries, convert_to_tensor=True, normalize_embeddings=True)
|
49 |
print("embed query")
|
50 |
print(time.time())
|
|
|
7 |
import time
|
8 |
|
9 |
model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
|
10 |
+
print("load model")
|
11 |
+
print(time.time())
|
12 |
+
|
13 |
+
hadiths = pd.read_csv('all_hadiths_clean.csv', delimiter=",")
|
14 |
+
document_embeddings = torch.load('encoded_hadiths_multilingual-e5-large-instruct (1).sav',map_location ='cpu')
|
15 |
+
#file = open('encoded_hadiths_multilingual-e5-large-instruct (1).sav','rb')
|
16 |
+
#document_embeddings = pickle.load(file)
|
17 |
+
print("load hadiths")
|
18 |
+
print(time.time())
|
19 |
|
20 |
# Define the function to categorize ages
|
21 |
def categorize_source(source):
|
|
|
46 |
print("start")
|
47 |
print(time.time())
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
query_embeddings = model.encode(queries, convert_to_tensor=True, normalize_embeddings=True)
|
50 |
print("embed query")
|
51 |
print(time.time())
|