Issue with processor.push_to_hub when pushing ViltProcessor to Hugging Face Hub

How about using upload instead using push_to_hub().

from huggingface_hub import login
login(token="Your hf token")
tokenizer.save_pretrained("./your path")

from huggingface_hub import HfApi, upload_folder, create_repo

# Replace with your Hugging Face access token and desired model name
hf_token = "Your hf token"
repo_name = "Your repository"

# Step 1: Create a repository on the Hub. If you have the repo don't run this code
create_repo(repo_name, token=hf_token)

# Step 2: Upload the folder to the repository
upload_folder(
    folder_path="./outputmodel",    # Path to the model folder
    repo_id=repo_name,          # Name of the repository
    token=hf_token,             # Your Hugging Face token
    commit_message="Initial model upload",
)
2 Likes