Prerequisites
Before you begin fine-tuning, ensure you have:- A Runpod account with access to the Fine Tuning feature
- (Optional) A Hugging Face access token for gated models
Select a base model
To start fine-tuning, you’ll need to choose a base model from Hugging Face:- Navigate to the Fine Tuning section in the sidebar
-
Enter the Hugging Face model ID in the Base Model field
- Example:
NousResearch/Meta-Llama-3-8B
- Example:
-
For gated models (requiring special access):
- Generate a Hugging Face token with appropriate permissions
- Add your token in the designated field
Select a dataset
You can choose a dataset from Hugging Face for fine-tuning:- Browse available datasets on Hugging Face
- Enter your chosen dataset identifier in the Dataset field
- Example:
tatsu-lab/alpaca
- Example:
Deploy the fine-tuning pod
Follow these steps to set up your training environment:- Click Deploy the Fine Tuning Pod
-
Select a GPU instance based on your model’s requirements:
- Smaller models: Choose GPUs with less memory
- Larger models/datasets: Choose GPUs with higher memory capacity
- Monitor the system logs for deployment progress
-
Wait for the success message:
"You've successfully configured your training environment!"
Connect to your training environment
After your pod is deployed and active, you can connect using any of these methods:- Go to your Fine Tuning pod dashboard
-
Click Connect and choose your preferred connection method:
- Jupyter Notebook: Browser-based notebook interface
- Web Terminal: Browser-based terminal
- SSH: Local machine terminal connection
To use SSH, add your public SSH key in your account settings. The system automatically adds your key to the pod’s
authorized_keys
file.Configure your environment
Your training environment includes this directory structure in/workspace/fine-tuning/
:
examples/
: Sample configurations and scriptsoutputs/
: Training results and model outputsconfig.yaml
: Training parameters for your model
config.yaml
based on your selected base model and dataset.
Review and modify the configuration
Theconfig.yaml
file controls your fine-tuning parameters. Here’s how to customize it:
-
Open the configuration file:
- Review and adjust the parameters based on your specific use case
The
config.yaml
file contains all hyperparameters needed for fine-tuning. You may need to iterate on these settings to achieve optimal results.Start the fine-tuning process
Once your configuration is ready, follow these steps:-
Start the training process:
- Monitor the training progress in your terminal
Push your model to Hugging Face
After completing the fine-tuning process, you can share your model:-
Log in to Hugging Face:
- Create a new repository on Hugging Face if needed
-
Upload your model:
<your-username>
with your Hugging Face username and <model-name>
with your desired model name.