Bofandra commited on
Commit
5f6349c
·
verified ·
1 Parent(s): 2274ef4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -12,10 +12,19 @@ def find(query):
12
  queries = [
13
  get_detailed_instruct(task, query)
14
  ]
 
15
 
16
  quran = pd.read_csv('quran-simple-clean.txt', delimiter="|")
17
- file = open('encoded_quran_text_split_multilingual-e5-large-instruct.sav','rb')
18
- document_embeddings = pickle.load(file)
 
 
 
 
 
 
 
 
19
  print("cekpoin1\n")
20
  model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
21
  query_embeddings = model.encode(queries, convert_to_tensor=True, normalize_embeddings=True)
 
12
  queries = [
13
  get_detailed_instruct(task, query)
14
  ]
15
+ print("cekpoin0\n")
16
 
17
  quran = pd.read_csv('quran-simple-clean.txt', delimiter="|")
18
+
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'
25
+ pickle.dump(embeddings, open(filename, 'wb'))
26
+ #file = open('encoded_quran_text_split_multilingual-e5-large-instruct.sav','rb')
27
+ #document_embeddings = pickle.load(file)
28
  print("cekpoin1\n")
29
  model = SentenceTransformer('intfloat/multilingual-e5-large-instruct')
30
  query_embeddings = model.encode(queries, convert_to_tensor=True, normalize_embeddings=True)