Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,9 +17,10 @@ import difflib
|
|
17 |
|
18 |
|
19 |
modelPath = "MSEAJYTHTH/NFPC"
|
20 |
-
db_files = "MSEAJYTHTH/NFPC"
|
21 |
# db_files = ["MSEAJYTHTH/NFPC/index.faiss", "MSEAJYTHTH/NFPC/index.pkl"]
|
22 |
|
|
|
|
|
23 |
|
24 |
model_kwargs = {'device':'cpu'}
|
25 |
|
@@ -33,7 +34,7 @@ embeddings = HuggingFaceEmbeddings(
|
|
33 |
|
34 |
|
35 |
# 두 파일을 업로드한 후에는 다음과 같이 코드를 수정할 수 있습니다.
|
36 |
-
db = FAISS.load_local(
|
37 |
|
38 |
|
39 |
def find_best_page_content(question, keywords, db):
|
|
|
17 |
|
18 |
|
19 |
modelPath = "MSEAJYTHTH/NFPC"
|
|
|
20 |
# db_files = ["MSEAJYTHTH/NFPC/index.faiss", "MSEAJYTHTH/NFPC/index.pkl"]
|
21 |
|
22 |
+
index = faiss.read_index('MSEAJYTHTH/NFPC/index.faiss')
|
23 |
+
|
24 |
|
25 |
model_kwargs = {'device':'cpu'}
|
26 |
|
|
|
34 |
|
35 |
|
36 |
# 두 파일을 업로드한 후에는 다음과 같이 코드를 수정할 수 있습니다.
|
37 |
+
db = FAISS.load_local(index, embeddings, allow_dangerous_deserialization=True)
|
38 |
|
39 |
|
40 |
def find_best_page_content(question, keywords, db):
|