joe4ai commited on
Commit
f74f442
·
verified ·
1 Parent(s): 1f341e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -41,13 +41,18 @@ DATASET_NAME = "faiss_index"
41
  index_path = "faiss_index"
42
 
43
  api = HfApi()
 
 
 
44
  api.upload_file(
45
- path_or_fileobj="chatbot.db", # Path to the database
46
- path_in_repo="chatbot.db", # Name inside the dataset
47
- repo_id=f"{HF_USERNAME}/{DATASET_NAME}", # Private dataset
48
  repo_type="dataset",
49
  token=HF_TOKEN
50
  )
 
 
51
  db_folder = snapshot_download(
52
  repo_id=f"{HF_USERNAME}/{DATASET_NAME}",
53
  allow_patterns=["chatbot.db"], # Only download the database
 
41
  index_path = "faiss_index"
42
 
43
  api = HfApi()
44
+ from pathlib import Path
45
+ db_path = str(Path("chatbot.db").resolve())
46
+
47
  api.upload_file(
48
+ path_or_fileobj=db_path, # Use absolute path
49
+ path_in_repo="chatbot.db",
50
+ repo_id=f"{HF_USERNAME}/{DATASET_NAME}",
51
  repo_type="dataset",
52
  token=HF_TOKEN
53
  )
54
+
55
+ )
56
  db_folder = snapshot_download(
57
  repo_id=f"{HF_USERNAME}/{DATASET_NAME}",
58
  allow_patterns=["chatbot.db"], # Only download the database