Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -32,15 +32,15 @@ embeddings = HuggingFaceEmbeddings(
|
|
32 |
|
33 |
def find_best_page_content(question, keywords, db):
|
34 |
|
35 |
-
db = FAISS.load_local("
|
36 |
results = db.similarity_search(question, k=50, fetch_k=50)
|
37 |
keywords = ', '.join(keywords) #
|
38 |
|
39 |
max_similarity = 0 # 최대 유사도 초기화
|
40 |
best_page_content = "" # 가장 유사한 결과 초기화
|
41 |
-
page_content = ""
|
42 |
-
metadata = ""
|
43 |
-
similarity_score = ""
|
44 |
|
45 |
for i in range(50) :
|
46 |
page_content = results[i].page_content
|
|
|
32 |
|
33 |
def find_best_page_content(question, keywords, db):
|
34 |
|
35 |
+
db = FAISS.load_local("faiss_index", embeddings, allow_dangerous_deserialization=True)
|
36 |
results = db.similarity_search(question, k=50, fetch_k=50)
|
37 |
keywords = ', '.join(keywords) #
|
38 |
|
39 |
max_similarity = 0 # 최대 유사도 초기화
|
40 |
best_page_content = "" # 가장 유사한 결과 초기화
|
41 |
+
page_content = "" # 초기화
|
42 |
+
metadata = "" # 초기화
|
43 |
+
similarity_score = "" # 초기화
|
44 |
|
45 |
for i in range(50) :
|
46 |
page_content = results[i].page_content
|