First step is create a HuggingFace Account at: https://www.huggingface.co
Choose a pre-trained LLM you want to customize:
The ‘models’ tab has majority of the open source large language models deployed and customisable
Choose the model you want to fine tune. Use the links marked in red to explore how you can load the model in your notebook. There are many open source models available from the most popular large language models like Gemma, Mistral, Llama, GPT and lots more. Choose a model of interest and load the model for experimentation following the Model card instructions.
This is where data is key. The correct data cleaned and free from errors for the specific task you want to fine tune must be carefully collected and prepared at this stage. It is also at this stage that you open up a notebook environment or cloud instance to begin your fine tuning approach. A sample notebook for this purpose can be found here: https://colab.research.google.com/github/huggingface/notebooks/blob/master/transformers_doc/training.ipynb
This stage is where most of the time is spent in creating a quality dataset and also experimenting with parameters and hyperparameters to ensure that the model works well. Once satisfied with training and validation results, we proceed.
Deployment to Hugging Face
There are two ways of deploying the customized model to hugging Face which are:
Once Model is successfully pushed and deployed, it appears on Model list as shown:
I hope this article provided you with important information on how you can proceed with fine tuning a Large Language Model (LLM) and deploying your fine tuned model to HuggingFace.
Ikechukwu Ogbuchi is an LLM Scientist at Orcawise
Ike a skilled professional passionate about people, technology and the rise of Artificial Intelligence(AI). I believe that with the help of active communities and collaboration among well meaning individuals, the power of AI can be harnessed for social good!