implant / script.py
umiuni's picture
Upload script.py with huggingface_hub
bd9d222 verified
raw
history blame
782 Bytes
from huggingface_hub import HfApi
# Replace with your actual access token (obtain from Hugging Face settings)
# Set up the Hugging Face API with authentication
api = HfApi()
# Specify the local file path and desired location in the repository
# local_file_path = "images.zip"
local_file_path = "script.py"
path_in_repo = local_file_path
# Define the repository ID and type
repo_id = "umiuni/implant"
repo_type = "dataset"
try:
# Upload the file with progress bar feedback
upload_result = api.upload_file(
path_or_fileobj=local_file_path,
path_in_repo=path_in_repo,
repo_id=repo_id,
repo_type=repo_type,
)
print(f"File uploaded successfully! Link: {upload_result['url']}")
except Exception as e:
print(f"An error occurred during upload: {e}")