Spaces:
Sleeping
Sleeping
test3
Browse files
app.py
CHANGED
|
@@ -437,8 +437,13 @@ if __name__ == "__main__":
|
|
| 437 |
try:
|
| 438 |
from huggingface_hub import HfApi
|
| 439 |
api = HfApi(token=os.environ.get("HF_TOKEN"))
|
| 440 |
-
|
| 441 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 442 |
except Exception as e:
|
| 443 |
print(f"Repo access check failed: {e}")
|
| 444 |
_ensure_data()
|
|
|
|
| 437 |
try:
|
| 438 |
from huggingface_hub import HfApi
|
| 439 |
api = HfApi(token=os.environ.get("HF_TOKEN"))
|
| 440 |
+
for rt in ("dataset", "model", "space"):
|
| 441 |
+
try:
|
| 442 |
+
info = api.repo_info(repo_id=_HF_REPO_ID, repo_type=rt)
|
| 443 |
+
print(f"Repo found as repo_type='{rt}': {info.id} (private={info.private})")
|
| 444 |
+
break
|
| 445 |
+
except Exception as e:
|
| 446 |
+
print(f"repo_type='{rt}': {e}")
|
| 447 |
except Exception as e:
|
| 448 |
print(f"Repo access check failed: {e}")
|
| 449 |
_ensure_data()
|