Diwash Barla aider (gemini/gemini-3-flash-preview) commited on
Commit
45fd485
·
1 Parent(s): 4fb263a

feat: add functionality to manage Hugging Face Space secrets

Browse files

Co-authored-by: aider (gemini/gemini-3-flash-preview) <aider@aider.chat>

Files changed (1) hide show
  1. create_space.py +13 -0
create_space.py CHANGED
@@ -15,5 +15,18 @@ def create_huggingface_space():
15
  except Exception as e:
16
  print(f"Error creating space: {e}")
17
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  if __name__ == "__main__":
19
  create_huggingface_space()
 
 
15
  except Exception as e:
16
  print(f"Error creating space: {e}")
17
 
18
+ def add_secret_to_space():
19
+ repo_id = "Aryan-x/viven-b2"
20
+ try:
21
+ api.add_space_secret(
22
+ repo_id=repo_id,
23
+ key="VIVEN_API_KEY",
24
+ value="viven@321"
25
+ )
26
+ print(f"Secret 'VIVEN_API_KEY' added to '{repo_id}' successfully.")
27
+ except Exception as e:
28
+ print(f"Error adding secret: {e}")
29
+
30
  if __name__ == "__main__":
31
  create_huggingface_space()
32
+ add_secret_to_space()