Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ import numpy as np
|
|
10 |
model = SentenceTransformer("moka-ai/m3e-base")
|
11 |
|
12 |
# Encode the documents into embeddings
|
13 |
-
documents = ["
|
14 |
document_embeddings = model.encode(documents)
|
15 |
|
16 |
# Store the embeddings to FAISS
|
@@ -18,7 +18,7 @@ index = faiss.IndexFlatIP(document_embeddings.shape[1])
|
|
18 |
index.add(document_embeddings)
|
19 |
|
20 |
# Encode the query into an embedding
|
21 |
-
query = "
|
22 |
query_embedding = model.encode([query])[0]
|
23 |
|
24 |
# Search the FAISS index for the most similar document
|
|
|
10 |
model = SentenceTransformer("moka-ai/m3e-base")
|
11 |
|
12 |
# Encode the documents into embeddings
|
13 |
+
documents = ["班车线路", "兴趣小组", "财务报销"]
|
14 |
document_embeddings = model.encode(documents)
|
15 |
|
16 |
# Store the embeddings to FAISS
|
|
|
18 |
index.add(document_embeddings)
|
19 |
|
20 |
# Encode the query into an embedding
|
21 |
+
query = "报销餐费"
|
22 |
query_embedding = model.encode([query])[0]
|
23 |
|
24 |
# Search the FAISS index for the most similar document
|