Instructions to use fay-ong/new-llamafactory-llama-3-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use fay-ong/new-llamafactory-llama-3-8b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3-8b-Instruct-bnb-4bit") model = PeftModel.from_pretrained(base_model, "fay-ong/new-llamafactory-llama-3-8b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use fay-ong/new-llamafactory-llama-3-8b with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for fay-ong/new-llamafactory-llama-3-8b to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for fay-ong/new-llamafactory-llama-3-8b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for fay-ong/new-llamafactory-llama-3-8b to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="fay-ong/new-llamafactory-llama-3-8b", max_seq_length=2048, )
File size: 1,942 Bytes
fcb0aaf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | {
"best_metric": null,
"best_model_checkpoint": null,
"epoch": 0.992,
"eval_steps": 500,
"global_step": 62,
"is_hyper_param_search": false,
"is_local_process_zero": true,
"is_world_process_zero": true,
"log_history": [
{
"epoch": 0.16,
"grad_norm": 1.7386187314987183,
"learning_rate": 1.9853538358476933e-05,
"loss": 0.2613,
"step": 10
},
{
"epoch": 0.32,
"grad_norm": 2.1634316444396973,
"learning_rate": 1.736741137876405e-05,
"loss": 0.216,
"step": 20
},
{
"epoch": 0.48,
"grad_norm": 2.8627727031707764,
"learning_rate": 1.2542183341934873e-05,
"loss": 0.1431,
"step": 30
},
{
"epoch": 0.64,
"grad_norm": 2.0235531330108643,
"learning_rate": 6.909830056250527e-06,
"loss": 0.088,
"step": 40
},
{
"epoch": 0.8,
"grad_norm": 1.9142417907714844,
"learning_rate": 2.2585838936091753e-06,
"loss": 0.107,
"step": 50
},
{
"epoch": 0.96,
"grad_norm": 1.0446289777755737,
"learning_rate": 6.51826465144978e-08,
"loss": 0.118,
"step": 60
},
{
"epoch": 0.992,
"step": 62,
"total_flos": 1.6166347506450432e+16,
"train_loss": 0.15166758986250048,
"train_runtime": 892.7422,
"train_samples_per_second": 0.56,
"train_steps_per_second": 0.069
}
],
"logging_steps": 10,
"max_steps": 62,
"num_input_tokens_seen": 0,
"num_train_epochs": 1,
"save_steps": 1000,
"stateful_callbacks": {
"TrainerControl": {
"args": {
"should_epoch_stop": false,
"should_evaluate": false,
"should_log": false,
"should_save": false,
"should_training_stop": false
},
"attributes": {}
}
},
"total_flos": 1.6166347506450432e+16,
"train_batch_size": 2,
"trial_name": null,
"trial_params": null
}
|