File size: 831 Bytes
4fb263a 035432a 4fb263a 45fd485 035432a 45fd485 4fb263a 45fd485 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | from huggingface_hub import HfApi
api = HfApi()
def create_huggingface_space():
repo_id = "viven-b3"
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-b3"
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()
|