Hello!
I am going to give you one tip to train your model and upload the huggingface hub.
I think this is very useful to upload the model from online coding sites(kaggle.com, colab and so on) without downloading your local.
Maybe some others have known this method, but I want to hope my code will be helpful to beginners.
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",
)
I hope your tips about my method.