Instructions to use yosa722/4B-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use yosa722/4B-instruct with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B-Instruct-2507") model = PeftModel.from_pretrained(base_model, "yosa722/4B-instruct") - Transformers
How to use yosa722/4B-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yosa722/4B-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("yosa722/4B-instruct", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yosa722/4B-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yosa722/4B-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yosa722/4B-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yosa722/4B-instruct
- SGLang
How to use yosa722/4B-instruct with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "yosa722/4B-instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yosa722/4B-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "yosa722/4B-instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yosa722/4B-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yosa722/4B-instruct with Docker Model Runner:
docker model run hf.co/yosa722/4B-instruct
Upload task output 1
Browse files- adapter_config.json +3 -3
- adapter_model.safetensors +1 -1
- loss.txt +1 -1
- trainer_state.json +5 -114
- training_args.bin +1 -1
adapter_config.json
CHANGED
|
@@ -29,12 +29,12 @@
|
|
| 29 |
"rank_pattern": {},
|
| 30 |
"revision": null,
|
| 31 |
"target_modules": [
|
|
|
|
|
|
|
| 32 |
"q_proj",
|
| 33 |
"v_proj",
|
| 34 |
-
"down_proj",
|
| 35 |
-
"o_proj",
|
| 36 |
"up_proj",
|
| 37 |
-
"
|
| 38 |
"gate_proj"
|
| 39 |
],
|
| 40 |
"target_parameters": null,
|
|
|
|
| 29 |
"rank_pattern": {},
|
| 30 |
"revision": null,
|
| 31 |
"target_modules": [
|
| 32 |
+
"down_proj",
|
| 33 |
+
"k_proj",
|
| 34 |
"q_proj",
|
| 35 |
"v_proj",
|
|
|
|
|
|
|
| 36 |
"up_proj",
|
| 37 |
+
"o_proj",
|
| 38 |
"gate_proj"
|
| 39 |
],
|
| 40 |
"target_parameters": null,
|
adapter_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 792791480
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c643c80855a4b213f8172169bcdea191932dca506f825ecd790ad6c419f258fb
|
| 3 |
size 792791480
|
loss.txt
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
2,no_eval
|
trainer_state.json
CHANGED
|
@@ -2,124 +2,15 @@
|
|
| 2 |
"best_global_step": null,
|
| 3 |
"best_metric": null,
|
| 4 |
"best_model_checkpoint": null,
|
| 5 |
-
"epoch": 0.
|
| 6 |
"eval_steps": 500,
|
| 7 |
-
"global_step":
|
| 8 |
"is_hyper_param_search": false,
|
| 9 |
"is_local_process_zero": true,
|
| 10 |
"is_world_process_zero": true,
|
| 11 |
-
"log_history": [
|
| 12 |
-
{
|
| 13 |
-
"epoch": 0.078125,
|
| 14 |
-
"grad_norm": 5.103673934936523,
|
| 15 |
-
"learning_rate": 3.657142857142857e-06,
|
| 16 |
-
"loss": 0.23,
|
| 17 |
-
"mean_token_accuracy": 0.9769149661064148,
|
| 18 |
-
"num_tokens": 805193.0,
|
| 19 |
-
"step": 5
|
| 20 |
-
},
|
| 21 |
-
{
|
| 22 |
-
"epoch": 0.15625,
|
| 23 |
-
"grad_norm": 0.7734425067901611,
|
| 24 |
-
"learning_rate": 8.228571428571427e-06,
|
| 25 |
-
"loss": 0.1056,
|
| 26 |
-
"mean_token_accuracy": 0.9816768169403076,
|
| 27 |
-
"num_tokens": 1615174.0,
|
| 28 |
-
"step": 10
|
| 29 |
-
},
|
| 30 |
-
{
|
| 31 |
-
"epoch": 0.234375,
|
| 32 |
-
"grad_norm": 0.35554370284080505,
|
| 33 |
-
"learning_rate": 1.28e-05,
|
| 34 |
-
"loss": 0.0461,
|
| 35 |
-
"mean_token_accuracy": 0.9830294609069824,
|
| 36 |
-
"num_tokens": 2423672.0,
|
| 37 |
-
"step": 15
|
| 38 |
-
},
|
| 39 |
-
{
|
| 40 |
-
"epoch": 0.3125,
|
| 41 |
-
"grad_norm": 0.19150610268115997,
|
| 42 |
-
"learning_rate": 1.737142857142857e-05,
|
| 43 |
-
"loss": 0.0413,
|
| 44 |
-
"mean_token_accuracy": 0.984943950176239,
|
| 45 |
-
"num_tokens": 3228657.0,
|
| 46 |
-
"step": 20
|
| 47 |
-
},
|
| 48 |
-
{
|
| 49 |
-
"epoch": 0.390625,
|
| 50 |
-
"grad_norm": 0.12925629317760468,
|
| 51 |
-
"learning_rate": 2.1942857142857143e-05,
|
| 52 |
-
"loss": 0.0372,
|
| 53 |
-
"mean_token_accuracy": 0.9861745119094849,
|
| 54 |
-
"num_tokens": 4031609.0,
|
| 55 |
-
"step": 25
|
| 56 |
-
},
|
| 57 |
-
{
|
| 58 |
-
"epoch": 0.46875,
|
| 59 |
-
"grad_norm": 0.1231900230050087,
|
| 60 |
-
"learning_rate": 2.6514285714285714e-05,
|
| 61 |
-
"loss": 0.0333,
|
| 62 |
-
"mean_token_accuracy": 0.9874817848205566,
|
| 63 |
-
"num_tokens": 4838464.0,
|
| 64 |
-
"step": 30
|
| 65 |
-
},
|
| 66 |
-
{
|
| 67 |
-
"epoch": 0.546875,
|
| 68 |
-
"grad_norm": 0.16564792394638062,
|
| 69 |
-
"learning_rate": 3.108571428571429e-05,
|
| 70 |
-
"loss": 0.0279,
|
| 71 |
-
"mean_token_accuracy": 0.9899692058563232,
|
| 72 |
-
"num_tokens": 5646156.0,
|
| 73 |
-
"step": 35
|
| 74 |
-
},
|
| 75 |
-
{
|
| 76 |
-
"epoch": 0.625,
|
| 77 |
-
"grad_norm": 0.17428471148014069,
|
| 78 |
-
"learning_rate": 3.0890905036051484e-05,
|
| 79 |
-
"loss": 0.0243,
|
| 80 |
-
"mean_token_accuracy": 0.9914502620697021,
|
| 81 |
-
"num_tokens": 6454792.0,
|
| 82 |
-
"step": 40
|
| 83 |
-
},
|
| 84 |
-
{
|
| 85 |
-
"epoch": 0.703125,
|
| 86 |
-
"grad_norm": 0.15789136290550232,
|
| 87 |
-
"learning_rate": 2.673424478434859e-05,
|
| 88 |
-
"loss": 0.0228,
|
| 89 |
-
"mean_token_accuracy": 0.991909658908844,
|
| 90 |
-
"num_tokens": 7262750.0,
|
| 91 |
-
"step": 45
|
| 92 |
-
},
|
| 93 |
-
{
|
| 94 |
-
"epoch": 0.78125,
|
| 95 |
-
"grad_norm": 0.17088592052459717,
|
| 96 |
-
"learning_rate": 2.064966690302501e-05,
|
| 97 |
-
"loss": 0.0188,
|
| 98 |
-
"mean_token_accuracy": 0.9934135437011719,
|
| 99 |
-
"num_tokens": 8066511.0,
|
| 100 |
-
"step": 50
|
| 101 |
-
},
|
| 102 |
-
{
|
| 103 |
-
"epoch": 0.859375,
|
| 104 |
-
"grad_norm": 0.16459356248378754,
|
| 105 |
-
"learning_rate": 1.437909871160252e-05,
|
| 106 |
-
"loss": 0.0178,
|
| 107 |
-
"mean_token_accuracy": 0.9938672065734864,
|
| 108 |
-
"num_tokens": 8874249.0,
|
| 109 |
-
"step": 55
|
| 110 |
-
},
|
| 111 |
-
{
|
| 112 |
-
"epoch": 0.9375,
|
| 113 |
-
"grad_norm": 0.12136869877576828,
|
| 114 |
-
"learning_rate": 9.717713885988932e-06,
|
| 115 |
-
"loss": 0.0172,
|
| 116 |
-
"mean_token_accuracy": 0.9943367838859558,
|
| 117 |
-
"num_tokens": 9683520.0,
|
| 118 |
-
"step": 60
|
| 119 |
-
}
|
| 120 |
-
],
|
| 121 |
"logging_steps": 5,
|
| 122 |
-
"max_steps":
|
| 123 |
"num_input_tokens_seen": 0,
|
| 124 |
"num_train_epochs": 1,
|
| 125 |
"save_steps": 500,
|
|
@@ -135,7 +26,7 @@
|
|
| 135 |
"attributes": {}
|
| 136 |
}
|
| 137 |
},
|
| 138 |
-
"total_flos":
|
| 139 |
"train_batch_size": 20,
|
| 140 |
"trial_name": null,
|
| 141 |
"trial_params": null
|
|
|
|
| 2 |
"best_global_step": null,
|
| 3 |
"best_metric": null,
|
| 4 |
"best_model_checkpoint": null,
|
| 5 |
+
"epoch": 0.6666666666666666,
|
| 6 |
"eval_steps": 500,
|
| 7 |
+
"global_step": 2,
|
| 8 |
"is_hyper_param_search": false,
|
| 9 |
"is_local_process_zero": true,
|
| 10 |
"is_world_process_zero": true,
|
| 11 |
+
"log_history": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
"logging_steps": 5,
|
| 13 |
+
"max_steps": 3,
|
| 14 |
"num_input_tokens_seen": 0,
|
| 15 |
"num_train_epochs": 1,
|
| 16 |
"save_steps": 500,
|
|
|
|
| 26 |
"attributes": {}
|
| 27 |
}
|
| 28 |
},
|
| 29 |
+
"total_flos": 1086238903762944.0,
|
| 30 |
"train_batch_size": 20,
|
| 31 |
"trial_name": null,
|
| 32 |
"trial_params": null
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 6417
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2de060513ab016865f49b76852f202fa534575054626c14c49710d45b8a985dd
|
| 3 |
size 6417
|