Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,16 +9,14 @@ import numpy as np
|
|
| 9 |
index_path = "faiss_index/index.faiss" # Update with your FAISS index file path
|
| 10 |
index = faiss.read_index(index_path)
|
| 11 |
|
| 12 |
-
# Load your embeddings model
|
| 13 |
-
embedding_model = SentenceTransformer("BAAI/bge-large-en-v1.5")
|
| 14 |
|
| 15 |
# Load the metadata
|
| 16 |
df = pd.read_pickle('df_news (1).pkl')
|
| 17 |
|
| 18 |
# Load the Hugging Face model and tokenizer
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
|
| 23 |
# Define the function for similarity search
|
| 24 |
def search(query, k=10):
|
|
|
|
| 9 |
index_path = "faiss_index/index.faiss" # Update with your FAISS index file path
|
| 10 |
index = faiss.read_index(index_path)
|
| 11 |
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# Load the metadata
|
| 14 |
df = pd.read_pickle('df_news (1).pkl')
|
| 15 |
|
| 16 |
# Load the Hugging Face model and tokenizer
|
| 17 |
+
model = SentenceTransformer("sentence-transformers/all-mpnet-base-v2")
|
| 18 |
+
hf_tokenizer = AutoTokenizer.from_pretrained('BAAI/bge-large-zh-v1.5')
|
| 19 |
+
hf_model = AutoModel.from_pretrained('BAAI/bge-large-zh-v1.5')
|
| 20 |
|
| 21 |
# Define the function for similarity search
|
| 22 |
def search(query, k=10):
|