0% found this document useful (0 votes)
15 views1 page

Huggingface Git & LFS Setup Guide

This document provides instructions for using the Hugging Face Git and Git LFS interface to create and manage repositories. It outlines the steps for logging in, creating a repository, cloning it, and pushing files, including large files. Additionally, it explains how to load models and tokenizers from the created repositories using compatible libraries.

Uploaded by

Komal Kothari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views1 page

Huggingface Git & LFS Setup Guide

This document provides instructions for using the Hugging Face Git and Git LFS interface to create and manage repositories. It outlines the steps for logging in, creating a repository, cloning it, and pushing files, including large files. Additionally, it explains how to load models and tokenizers from the created repositories using compatible libraries.

Uploaded by

Komal Kothari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Huggingface GPT

================

Getting started with our git and git-lfs interface

You can create a repository from the CLI (skip if you created a repo from the
website)

pip install huggingface_hub


You already have it if you installed transformers or datasets

huggingface-cli login
Log in using a token from huggingface.co/settings/tokens
Create a model or dataset repo from the CLI if needed
huggingface-cli repo create repo_name --type {model, dataset, space}
Clone your model, dataset or Space locally

Make sure you have git-lfs installed


(https://git-lfs.github.com)
git lfs install
git clone https://huggingface.co/username/repo_name
Then add, commit and push any file you want, including larges files

save files via `.save_pretrained()` or move them here


git add .
git commit -m "commit from $USER"
git push
In most cases, if you're using one of the compatible libraries, your repo will then
be accessible from code, through its identifier: username/repo_name

For example for a transformers model, anyone can load it with:

tokenizer = AutoTokenizer.from_pretrained("username/repo_name")
model = AutoModel.from_pretrained("username/repo_name")

You might also like