debugging to get space_id
Browse files
app.py
CHANGED
@@ -21,7 +21,15 @@ def space_hardware_config(instance_size: str="gpu",
|
|
21 |
This will manually select what hardware we'll use in the space.
|
22 |
"""
|
23 |
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
space_info = api.repo_info(repo_id=space_id, repo_type="space", token=token)
|
26 |
print(space_info)
|
27 |
|
|
|
21 |
This will manually select what hardware we'll use in the space.
|
22 |
"""
|
23 |
|
24 |
+
api = HfApi()
|
25 |
+
token = HfFolder.get_token()
|
26 |
+
if token is None:
|
27 |
+
raise ValueError("Hugging Face token not found. Please log in using huggingface-cli or set the token manually.")
|
28 |
+
|
29 |
+
space_id = os.getenv("SPACE_ID")
|
30 |
+
if not space_id:
|
31 |
+
raise ValueError("SPACE_ID environment variable not found.")
|
32 |
+
|
33 |
space_info = api.repo_info(repo_id=space_id, repo_type="space", token=token)
|
34 |
print(space_info)
|
35 |
|