Spaces:
Runtime error
Runtime error
from huggingface_hub import HfApi | |
import os | |
# Initialize the Hugging Face API client | |
api = HfApi() | |
# Create a new Space | |
space_name = "language-detection-api" | |
api.create_repo( | |
repo_id=space_name, | |
repo_type="space", | |
space_sdk="docker", | |
private=False | |
) | |
print(f"Space created successfully: https://huggingface.co./spaces/{os.getenv('HUGGING_FACE_HUB_TOKEN').split('/')[0]}/{space_name}") | |