Spaces:
Runtime error
Runtime error
Update app/services/hf_datasets.py
Browse files- app/services/hf_datasets.py +18 -7
app/services/hf_datasets.py
CHANGED
|
@@ -186,19 +186,30 @@ HF_ORG = "cskokgibbs"
|
|
| 186 |
api = HfApi()
|
| 187 |
|
| 188 |
@lru_cache(maxsize=1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
def list_beeline_datasets():
|
| 190 |
-
""
|
| 191 |
-
Discover BEELINE datasets from HF Hub
|
| 192 |
-
"""
|
| 193 |
-
repos = api.list_datasets(author=HF_ORG)
|
| 194 |
|
| 195 |
return [
|
| 196 |
-
|
| 197 |
-
for
|
| 198 |
-
if "BEELINE"
|
|
|
|
| 199 |
]
|
| 200 |
|
| 201 |
|
|
|
|
| 202 |
def extract_metadata(dataset_id: str):
|
| 203 |
"""
|
| 204 |
Extract metadata from HF Data Studio + files
|
|
|
|
| 186 |
api = HfApi()
|
| 187 |
|
| 188 |
@lru_cache(maxsize=1)
|
| 189 |
+
# def list_beeline_datasets():
|
| 190 |
+
# """
|
| 191 |
+
# Discover BEELINE datasets from HF Hub
|
| 192 |
+
# """
|
| 193 |
+
# repos = api.list_datasets(author=HF_ORG)
|
| 194 |
+
|
| 195 |
+
# return [
|
| 196 |
+
# repo.id
|
| 197 |
+
# for repo in repos
|
| 198 |
+
# if "BEELINE" in repo.id
|
| 199 |
+
# ]
|
| 200 |
+
|
| 201 |
def list_beeline_datasets():
|
| 202 |
+
datasets = api.list_datasets(author="cskokgibbs")
|
|
|
|
|
|
|
|
|
|
| 203 |
|
| 204 |
return [
|
| 205 |
+
d.id
|
| 206 |
+
for d in datasets
|
| 207 |
+
if d.id.startswith("cskokgibbs/BEELINE")
|
| 208 |
+
and not d.id.endswith("-cache")
|
| 209 |
]
|
| 210 |
|
| 211 |
|
| 212 |
+
|
| 213 |
def extract_metadata(dataset_id: str):
|
| 214 |
"""
|
| 215 |
Extract metadata from HF Data Studio + files
|