MohammedNasser commited on
Commit
9ef5b1e
·
verified ·
1 Parent(s): 3759483

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -63,7 +63,7 @@ def save_faiss_index_to_hub(vectorstore, repo_id="MohammedNasser/faiss-index"):
63
  vectorstore.save_local(index_dir)
64
 
65
  # Initialize Hugging Face repository
66
- repo = Repository(local_dir=index_dir, clone_from=repo_id)
67
 
68
  # Push the FAISS index files to the Hugging Face Hub
69
  repo.push_to_hub(commit_message="Pushing FAISS index")
@@ -91,8 +91,8 @@ def load_vectorstore(repo_id="MohammedNasser/faiss-index"):
91
 
92
 
93
  # Download the FAISS index files from Hugging Face Hub
94
- hf_hub_download(repo_id=repo_id, filename="index.faiss", local_dir=index_dir)
95
- hf_hub_download(repo_id=repo_id, filename="index.json", local_dir=index_dir)
96
  vectorstore = FAISS.load_local(index_dir, embeddings, allow_dangerous_deserialization=True)
97
  return vectorstore
98
 
 
63
  vectorstore.save_local(index_dir)
64
 
65
  # Initialize Hugging Face repository
66
+ repo = Repository(local_dir=index_dir, clone_from=repo_id, repo_type="dataset")
67
 
68
  # Push the FAISS index files to the Hugging Face Hub
69
  repo.push_to_hub(commit_message="Pushing FAISS index")
 
91
 
92
 
93
  # Download the FAISS index files from Hugging Face Hub
94
+ hf_hub_download(repo_id=repo_id, filename="index.faiss", local_dir=index_dir, repo_type="dataset")
95
+ hf_hub_download(repo_id=repo_id, filename="index.json", local_dir=index_dir, repo_type="dataset")
96
  vectorstore = FAISS.load_local(index_dir, embeddings, allow_dangerous_deserialization=True)
97
  return vectorstore
98