shroogawh2 commited on
Commit
b573fa6
·
verified ·
1 Parent(s): d57e3be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
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
- hf_model_name = "gpt-2" # Replace with your desired Hugging Face model
20
- hf_model = AutoModelForCausalLM.from_pretrained(hf_model_name)
21
- hf_tokenizer = AutoTokenizer.from_pretrained(hf_model_name)
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):