RoAr777 commited on
Commit
5190795
·
verified ·
1 Parent(s): f96bbd9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -6
app.py CHANGED
@@ -13,12 +13,18 @@ import pickle
13
  model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
14
  index = faiss.read_index('IPC_index.faiss')
15
  index2 = faiss.read_index('CrpC_index.faiss')
16
- flattened_data = pickle.load('IPC_F')
17
- pdf_filenames = pickle.load('IPC_N')
18
- chunk_indices = pickle.load('IPC_C')
19
- flattened_data2 = pickle.load('CrPC_F')
20
- pdf_filenames2 = pickle.load('CrPC_N')
21
- chunk_indices2 = pickle.load('CrPC_C')
 
 
 
 
 
 
22
  # Step 3: Retrieval with Citations using PDF filename
23
  def retrieve_info_with_citation(query, top_k=5):
24
  query_embedding = model.encode([query])
 
13
  model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
14
  index = faiss.read_index('IPC_index.faiss')
15
  index2 = faiss.read_index('CrpC_index.faiss')
16
+ with open('IPC_N.pkl', 'rb') as f:
17
+ flattened_data = pickle.load(f)
18
+ with open('IPC_F.pkl', 'rb') as f:
19
+ pdf_filenames = pickle.load(f)
20
+ with open('IPC_C.pkl', 'rb') as f:
21
+ chunk_indices = pickle.load(f)
22
+ with open('CrPC_N.pkl', 'rb') as f:
23
+ flattened_data2 = pickle.load(f)
24
+ with open('CrPC_F.pkl', 'rb') as f:
25
+ pdf_filenames2 = pickle.load(f)
26
+ with open('CrPC_C.pkl', 'rb') as f:
27
+ chunk_indices2 = pickle.load(f)
28
  # Step 3: Retrieval with Citations using PDF filename
29
  def retrieve_info_with_citation(query, top_k=5):
30
  query_embedding = model.encode([query])