File size: 356 Bytes
267745f
 
 
 
fb9f53e
267745f
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from huggingface_hub import HfApi
from dotenv import load_dotenv
import os

load_dotenv()
# Replace with your actual token and space details
HF_TOKEN = os.environ.get("HF_TOKEN")
REPO_ID = "zqu2004/Test"

# Initialize the API client
api = HfApi(token=HF_TOKEN)

# Restart the Space
api.restart_space(repo_id=REPO_ID)

print("Space restarted successfully.")