layout_ubiai / upload_model2.py
albertosei's picture
Upload folder using huggingface_hub
f79e8d6 verified
raw
history blame contribute delete
771 Bytes
# upload_model.py
from huggingface_hub import HfApi, HfFolder
# Define your model path and the desired repository ID on the Hub
MODEL_PATH = r"C:\Users\alber\OneDrive\Desktop\PROJECTS\TYNCAD\UBIAI\Layoutmv" # Path to your local model folder
REPO_ID = "albertosei/layout_ubiai" #
print(f"Uploading model from '{MODEL_PATH}' to '{REPO_ID}'...")
# The library will automatically find and use the token you just saved.
api = HfApi()
# Create the repository on the Hub if it doesn't exist
api.create_repo(repo_id=REPO_ID, repo_type="model", exist_ok=True)
# Upload the entire folder
api.upload_folder(
folder_path=MODEL_PATH,
repo_id=REPO_ID,
repo_type="model",
)
print("✅ Upload complete! Check your model on the Hugging Face Hub.")