Spaces:
Sleeping
Sleeping
Ajaykanth Maddi commited on
Commit ·
3304118
1
Parent(s): 5cb327f
Code Changes - HF Repo Check
Browse files- ragbench.py +13 -2
ragbench.py
CHANGED
|
@@ -114,12 +114,23 @@ class RAGSystem:
|
|
| 114 |
# 1. First verify the repo exists
|
| 115 |
print("Checking Hugging Face repository...")
|
| 116 |
api = HfApi()
|
| 117 |
-
|
| 118 |
repo_id=HF_DATASET_REPO_NAME,
|
| 119 |
repo_type=HF_REPO_TYPE, # or "model" if you used model repo
|
| 120 |
token=os.getenv("HF_TOKEN")
|
| 121 |
)
|
| 122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
|
| 124 |
# 2. List files to verify filename
|
| 125 |
repo_files = api.list_repo_files(
|
|
|
|
| 114 |
# 1. First verify the repo exists
|
| 115 |
print("Checking Hugging Face repository...")
|
| 116 |
api = HfApi()
|
| 117 |
+
bResult = api.repo_exists(
|
| 118 |
repo_id=HF_DATASET_REPO_NAME,
|
| 119 |
repo_type=HF_REPO_TYPE, # or "model" if you used model repo
|
| 120 |
token=os.getenv("HF_TOKEN")
|
| 121 |
)
|
| 122 |
+
|
| 123 |
+
if not bResult:
|
| 124 |
+
print(f"Repository {HF_DATASET_REPO_NAME} does not exist.")
|
| 125 |
+
return False
|
| 126 |
+
print(f"Repository {HF_DATASET_REPO_NAME} exists.")
|
| 127 |
+
|
| 128 |
+
# repo_info = api.repo_info(
|
| 129 |
+
# repo_id=HF_DATASET_REPO_NAME,
|
| 130 |
+
# repo_type=HF_REPO_TYPE, # or "model" if you used model repo
|
| 131 |
+
# token=os.getenv("HF_TOKEN")
|
| 132 |
+
# )
|
| 133 |
+
# print(f"Repo exists: {repo_info}")
|
| 134 |
|
| 135 |
# 2. List files to verify filename
|
| 136 |
repo_files = api.list_repo_files(
|