Instructions to use Ben-3id/Tutorial-FineTune with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Ben-3id/Tutorial-FineTune with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B") model = PeftModel.from_pretrained(base_model, "Ben-3id/Tutorial-FineTune") - Transformers
How to use Ben-3id/Tutorial-FineTune with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ben-3id/Tutorial-FineTune") 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("Ben-3id/Tutorial-FineTune", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Ben-3id/Tutorial-FineTune with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ben-3id/Tutorial-FineTune" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ben-3id/Tutorial-FineTune", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Ben-3id/Tutorial-FineTune
- SGLang
How to use Ben-3id/Tutorial-FineTune 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 "Ben-3id/Tutorial-FineTune" \ --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": "Ben-3id/Tutorial-FineTune", "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 "Ben-3id/Tutorial-FineTune" \ --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": "Ben-3id/Tutorial-FineTune", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Ben-3id/Tutorial-FineTune with Docker Model Runner:
docker model run hf.co/Ben-3id/Tutorial-FineTune
Download checkpoint-1225/trainer_state.json from Ben-3id/Tutorial-FineTune: direct link, hf CLI and curl.
- Browser
- Download file 5.4 kB
-
https://huggingface.co/Ben-3id/Tutorial-FineTune/resolve/main/checkpoint-1225/trainer_state.json
- Command line
-
hf download hf://Ben-3id/Tutorial-FineTune/checkpoint-1225/trainer_state.json
-
curl -L -o trainer_state.json https://huggingface.co/Ben-3id/Tutorial-FineTune/resolve/main/checkpoint-1225/trainer_state.json
5.4 kB
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 1.0, | |
| "eval_steps": 500, | |
| "global_step": 1225, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "entropy": 2.65348322480917, | |
| "epoch": 0.08163265306122448, | |
| "grad_norm": 0.3858589231967926, | |
| "learning_rate": 9.839710975789937e-05, | |
| "loss": 1.8520664978027344, | |
| "mean_token_accuracy": 0.4766763444710523, | |
| "num_tokens": 73931.0, | |
| "step": 100 | |
| }, | |
| { | |
| "entropy": 2.221065641641617, | |
| "epoch": 0.16326530612244897, | |
| "grad_norm": 0.4490025043487549, | |
| "learning_rate": 9.362871573431047e-05, | |
| "loss": 1.7005967712402343, | |
| "mean_token_accuracy": 0.5576045931689442, | |
| "num_tokens": 156572.0, | |
| "step": 200 | |
| }, | |
| { | |
| "entropy": 2.128404154591262, | |
| "epoch": 0.24489795918367346, | |
| "grad_norm": 0.568897008895874, | |
| "learning_rate": 8.600655546367782e-05, | |
| "loss": 1.6693995666503907, | |
| "mean_token_accuracy": 0.5640898733213544, | |
| "num_tokens": 244559.0, | |
| "step": 300 | |
| }, | |
| { | |
| "entropy": 2.096652089692652, | |
| "epoch": 0.32653061224489793, | |
| "grad_norm": 0.6031016111373901, | |
| "learning_rate": 7.602919653718044e-05, | |
| "loss": 1.5418077087402344, | |
| "mean_token_accuracy": 0.5770933660492301, | |
| "num_tokens": 334289.0, | |
| "step": 400 | |
| }, | |
| { | |
| "entropy": 2.0537689401954413, | |
| "epoch": 0.40816326530612246, | |
| "grad_norm": 0.5750653743743896, | |
| "learning_rate": 6.434926073521803e-05, | |
| "loss": 1.5946527099609376, | |
| "mean_token_accuracy": 0.5710043688677251, | |
| "num_tokens": 415705.0, | |
| "step": 500 | |
| }, | |
| { | |
| "epoch": 0.40816326530612246, | |
| "eval_entropy": 1.5940086383085985, | |
| "eval_loss": 1.6339383125305176, | |
| "eval_mean_token_accuracy": 0.6421380157654102, | |
| "eval_num_tokens": 415705.0, | |
| "eval_runtime": 3.1459, | |
| "eval_samples_per_second": 31.787, | |
| "eval_steps_per_second": 4.132, | |
| "step": 500 | |
| }, | |
| { | |
| "entropy": 2.0754134288430213, | |
| "epoch": 0.4897959183673469, | |
| "grad_norm": 1.2727973461151123, | |
| "learning_rate": 5.173073585798768e-05, | |
| "loss": 1.6228317260742187, | |
| "mean_token_accuracy": 0.564216209501028, | |
| "num_tokens": 494295.0, | |
| "step": 600 | |
| }, | |
| { | |
| "entropy": 2.012790724672377, | |
| "epoch": 0.5714285714285714, | |
| "grad_norm": 0.2896394729614258, | |
| "learning_rate": 3.899900307419982e-05, | |
| "loss": 1.5738545227050782, | |
| "mean_token_accuracy": 0.5796110359393061, | |
| "num_tokens": 577751.0, | |
| "step": 700 | |
| }, | |
| { | |
| "entropy": 1.9897139368206262, | |
| "epoch": 0.6530612244897959, | |
| "grad_norm": 0.5676203370094299, | |
| "learning_rate": 2.6986848512742967e-05, | |
| "loss": 1.5871757507324218, | |
| "mean_token_accuracy": 0.5866536642797291, | |
| "num_tokens": 658206.0, | |
| "step": 800 | |
| }, | |
| { | |
| "entropy": 2.0891294856369496, | |
| "epoch": 0.7346938775510204, | |
| "grad_norm": 0.4007723033428192, | |
| "learning_rate": 1.647999049387474e-05, | |
| "loss": 1.6784550476074218, | |
| "mean_token_accuracy": 0.5773500371165574, | |
| "num_tokens": 738593.0, | |
| "step": 900 | |
| }, | |
| { | |
| "entropy": 2.0181680861487985, | |
| "epoch": 0.8163265306122449, | |
| "grad_norm": 0.4596865475177765, | |
| "learning_rate": 8.165685478668238e-06, | |
| "loss": 1.6400236511230468, | |
| "mean_token_accuracy": 0.5852108645252884, | |
| "num_tokens": 817014.0, | |
| "step": 1000 | |
| }, | |
| { | |
| "epoch": 0.8163265306122449, | |
| "eval_entropy": 1.5638046906544611, | |
| "eval_loss": 1.6097618341445923, | |
| "eval_mean_token_accuracy": 0.6478444796342117, | |
| "eval_num_tokens": 817014.0, | |
| "eval_runtime": 3.1122, | |
| "eval_samples_per_second": 32.132, | |
| "eval_steps_per_second": 4.177, | |
| "step": 1000 | |
| }, | |
| { | |
| "entropy": 2.016655530370772, | |
| "epoch": 0.8979591836734694, | |
| "grad_norm": 0.6038398742675781, | |
| "learning_rate": 2.587774435638679e-06, | |
| "loss": 1.6814262390136718, | |
| "mean_token_accuracy": 0.579078944325447, | |
| "num_tokens": 896645.0, | |
| "step": 1100 | |
| }, | |
| { | |
| "entropy": 2.061556413136423, | |
| "epoch": 0.9795918367346939, | |
| "grad_norm": 0.6863688826560974, | |
| "learning_rate": 1.1111005402286711e-07, | |
| "loss": 1.64010009765625, | |
| "mean_token_accuracy": 0.5714908703416586, | |
| "num_tokens": 973715.0, | |
| "step": 1200 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "eval_entropy": 1.5626688462037306, | |
| "eval_loss": 1.609505295753479, | |
| "eval_mean_token_accuracy": 0.6479680950825031, | |
| "eval_num_tokens": 992320.0, | |
| "eval_runtime": 3.1267, | |
| "eval_samples_per_second": 31.982, | |
| "eval_steps_per_second": 4.158, | |
| "step": 1225 | |
| } | |
| ], | |
| "logging_steps": 100, | |
| "max_steps": 1225, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 1, | |
| "save_steps": 100, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 3710062484688384.0, | |
| "train_batch_size": 2, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |