deepfake_face_detection / deploy_to_hf.py
Freka22's picture
Upload 4 files
391d6ca verified
Raw
History Blame Contribute Delete
766 Bytes
import os
from huggingface_hub import HfApi, login
# Replace with your Hugging Face Token (e.g., hf_...)
HF_TOKEN = "your_hugging_face_token_here"
# Replace with your Hugging Face username and your desired Space name
REPO_ID = "YourUsername/Deepfake-Image-Detector"
def deploy():
# Login to Hugging Face
login(token=HF_TOKEN, add_to_git_credential=True)
api = HfApi()
print(f"Uploading files to Hugging Face Space: {REPO_ID}...")
# Upload the entire current folder to the Space
api.upload_folder(
folder_path=".",
repo_id=REPO_ID,
repo_type="space"
)
print("✅ Successfully deployed! Your space should be building now.")
if __name__ == "__main__":
deploy()