Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -19,6 +19,8 @@ def find(query):
|
|
19 |
file = open('quran-splitted.sav','rb')
|
20 |
quran_splitted = pickle.load(file)
|
21 |
|
|
|
|
|
22 |
documents = quran_splitted['text'].tolist()
|
23 |
document_embeddings = model.encode(documents, convert_to_tensor=True, normalize_embeddings=True)
|
24 |
filename = 'encoded_quran_text_split_multilingual-e5-large-instruct.sav'
|
@@ -26,7 +28,7 @@ def find(query):
|
|
26 |
#file = open('encoded_quran_text_split_multilingual-e5-large-instruct.sav','rb')
|
27 |
#document_embeddings = pickle.load(file)
|
28 |
print("cekpoin1\n")
|
29 |
-
|
30 |
query_embeddings = model.encode(queries, convert_to_tensor=True, normalize_embeddings=True)
|
31 |
scores = (query_embeddings @ document_embeddings.T) * 100
|
32 |
print("cekpoin2\n")
|
|
|
19 |
file = open('quran-splitted.sav','rb')
|
20 |
quran_splitted = pickle.load(file)
|
21 |
|
22 |
+
model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
|
23 |
+
|
24 |
documents = quran_splitted['text'].tolist()
|
25 |
document_embeddings = model.encode(documents, convert_to_tensor=True, normalize_embeddings=True)
|
26 |
filename = 'encoded_quran_text_split_multilingual-e5-large-instruct.sav'
|
|
|
28 |
#file = open('encoded_quran_text_split_multilingual-e5-large-instruct.sav','rb')
|
29 |
#document_embeddings = pickle.load(file)
|
30 |
print("cekpoin1\n")
|
31 |
+
|
32 |
query_embeddings = model.encode(queries, convert_to_tensor=True, normalize_embeddings=True)
|
33 |
scores = (query_embeddings @ document_embeddings.T) * 100
|
34 |
print("cekpoin2\n")
|