viven-b6 / create_space.py
Diwash Barla
feat: update space and secret repository IDs to viven-b5
c06c525
Raw
History Blame Contribute Delete
831 Bytes
from huggingface_hub import HfApi
api = HfApi()
def create_huggingface_space():
repo_id = "viven-b5"
try:
api.create_repo(
repo_id=repo_id,
repo_type="space",
space_sdk="docker",
private=False
)
print(f"Space '{repo_id}' created successfully.")
except Exception as e:
print(f"Error creating space: {e}")
def add_secret_to_space():
repo_id = "Aryan-x/viven-b5"
try:
api.add_space_secret(
repo_id=repo_id,
key="VIVEN_API_KEY",
value="viven@321"
)
print(f"Secret 'VIVEN_API_KEY' added to '{repo_id}' successfully.")
except Exception as e:
print(f"Error adding secret: {e}")
if __name__ == "__main__":
create_huggingface_space()
add_secret_to_space()