LLaMA is not licensed for commercial use
The LLaMA model is not currently licensed for commercial use. LLaMA fine-tuning is offered for research purposes.
Build a config
Once your config is set, use it to create a
You can get your run's status with:
Once the run starts (
RUNNING), stream logs with:
Monitor your run with Weights & Biases
Blueprint fine-tuning can integrate with Weights & Biases to monitor your fine-tuning run:
wandb_api_key="YOUR_API_KEY"to enable the integration.
image_log_stepsto control how many steps you see images for
This will enable you to see your model generate images as it is being fine-tuned.
If your model doesn't generate the results you'd like, there may be a couple issues:
Learning Rate: Your learning rate might've been too high or too low. A smaller learning rate ensures a more gradual convergence but may require more training time, while a larger learning rate may cause the model to overshoot the optimal solution. To remedy this, you can use the
learning_rateparameter to set your learning rate in the
Dataset: Your dataset might not have enough examples or the examples are poorly formatted. It's important to thorougly clean and preprocess your dataset before kicking off the job. If there are extraneous HTML tags, erratic whitespaces or unknown characters found in the dataset, this may cause model quality issues.
Weight Decay: You may've overfit or underfit on the dataset. Overfitting is when the model begins to memorize your training data. Underfitting is when the model struggle to find a function that maps from your input data to your output data. You can apply weight decay (L2 regularization) to prevent overfitting and improve generalization. Start with a small weight decay value (e.g., 1e-5 or 1e-4) and experiment with different values to find the right balance between overfitting and underfitting.
LlamaConfig reference for a complete list of parameters.
Your model will be automatically deployed
Once the fine-tuning run is complete, your model will be automatically deployed. You'll receive an email when the deployment is finished and the model is ready to invoke.
You can turn off this behavior by setting
FinetuningRun.create() and instead deploy your model manually.
Once your model is deployed, you can invoke it:
View our docs on the
Llama() model object here
The model returns: