Finetune your first model
To get started, create an account on Haven. You will now automatically get $5 in credits.
Create a dataset file
Your dataset should be a jsonl
file (a file containing a json object in every line), following the same format as the OpenAI fine-tuning data format. The first message should be a system
message, and afterwards, roles should alternate between user
and assistant
:
You can download an example dataset here.
Start a Finetuning Run
To start a finetuning run, click onto “Train a model” in Haven’s dashboard.
Now, upload your file and indicate the following parameters in the form:
- Model Name: This is where the fine-tuned model will be uploaded to on Huggingface, should be of format
your-hf-username/your-model-name
- Training Dataset: Your training dataset file.
- Base model: Model you want to finetune. We suggest HuggingFaceH4/zephyr-7b-beta.
- Learning Rate: Can be
high
,medium
orlow
. In general, smaller datasets with less than 500 chats should usehigh
. - Number of epochs: The number of training iterations over your full dataset. This value should normally be in the range of one to five.
- Huggingface Token: A write-access Huggingface token to upload your model. To obtain an access token, see here.
Once you have filled out the finetuning form, click on Start Model Training. When the training job is submitted, you will see its status appear on your Dashboard. You will also be able to see fine-tuning logs from Weights and Biases.
Testing your trained Model
Once training has finished, you will be able to see your model repository by clicking onto the Huggingface button in Haven’s dashboard.
If you have access to a GPU (free instances are available on Google Colab) you can test it with the transformers
/ peft
library:
More efficient deployment options include:
- Self-Hosting on AWS / GCP with vllm
- Running the model on your laptop using llama.cpp
- Deploying a Huggingface Inference Endpoint
- Running on Haven (coming soon)