sandz7 commited on
Commit
708593d
Β·
1 Parent(s): 5ff6ef4

debugging to get space id

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -21,8 +21,16 @@ def space_hardware_config(instance_size: str="gpu",
21
  This will manually select what hardware we'll use in the space.
22
  """
23
 
24
- # Get Space
25
- space_info = api.repo_info(repo_id=space_id)
 
 
 
 
 
 
 
 
26
  print(space_info)
27
 
28
  # # Hardware Configuration
 
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
 
36
  # # Hardware Configuration