Instructions to use astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/DeepSeek-R1-Distill-Qwen-14B-bnb-4bit") model = PeftModel.from_pretrained(base_model, "astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora") - Transformers
How to use astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora
- SGLang
How to use astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora 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 "astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora" \ --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": "astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora", "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 "astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora" \ --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": "astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora 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 astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora 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 astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora", max_seq_length=2048, ) - Docker Model Runner
How to use astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora with Docker Model Runner:
docker model run hf.co/astorlui77/DeepSeek-R1-14B-MathPhysics-v2-lora
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 0.0885783179961616, | |
| "eval_steps": 500, | |
| "global_step": 225, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.0019683102056884164, | |
| "grad_norm": 0.15222452580928802, | |
| "learning_rate": 4e-05, | |
| "loss": 1.5145992279052733, | |
| "step": 5 | |
| }, | |
| { | |
| "epoch": 0.003936620411376833, | |
| "grad_norm": 0.25713402032852173, | |
| "learning_rate": 9e-05, | |
| "loss": 1.4644563674926758, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.00590493061706525, | |
| "grad_norm": 0.18192017078399658, | |
| "learning_rate": 0.00014, | |
| "loss": 1.2352377891540527, | |
| "step": 15 | |
| }, | |
| { | |
| "epoch": 0.007873240822753666, | |
| "grad_norm": 0.2997220456600189, | |
| "learning_rate": 0.00019, | |
| "loss": 1.059535598754883, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.009841551028442082, | |
| "grad_norm": 0.2566224932670593, | |
| "learning_rate": 0.00019555555555555556, | |
| "loss": 0.7871951103210449, | |
| "step": 25 | |
| }, | |
| { | |
| "epoch": 0.0118098612341305, | |
| "grad_norm": 0.27674880623817444, | |
| "learning_rate": 0.00019, | |
| "loss": 0.5399114608764648, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.013778171439818916, | |
| "grad_norm": 0.23078280687332153, | |
| "learning_rate": 0.00018444444444444446, | |
| "loss": 0.3415979385375977, | |
| "step": 35 | |
| }, | |
| { | |
| "epoch": 0.01574648164550733, | |
| "grad_norm": 0.30523088574409485, | |
| "learning_rate": 0.0001788888888888889, | |
| "loss": 0.2282104015350342, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.01771479185119575, | |
| "grad_norm": 0.173019140958786, | |
| "learning_rate": 0.00017333333333333334, | |
| "loss": 0.15973645448684692, | |
| "step": 45 | |
| }, | |
| { | |
| "epoch": 0.019683102056884165, | |
| "grad_norm": 0.13935033977031708, | |
| "learning_rate": 0.0001677777777777778, | |
| "loss": 0.07095953226089477, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.02165141226257258, | |
| "grad_norm": 0.18054886162281036, | |
| "learning_rate": 0.00016222222222222224, | |
| "loss": 0.1123568058013916, | |
| "step": 55 | |
| }, | |
| { | |
| "epoch": 0.023619722468261, | |
| "grad_norm": 0.24172309041023254, | |
| "learning_rate": 0.00015666666666666666, | |
| "loss": 0.10775176286697388, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.025588032673949414, | |
| "grad_norm": 0.3667204678058624, | |
| "learning_rate": 0.0001511111111111111, | |
| "loss": 0.10995625257492066, | |
| "step": 65 | |
| }, | |
| { | |
| "epoch": 0.027556342879637832, | |
| "grad_norm": 0.11734714359045029, | |
| "learning_rate": 0.00014555555555555556, | |
| "loss": 0.06654936075210571, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 0.029524653085326247, | |
| "grad_norm": 0.12473294883966446, | |
| "learning_rate": 0.00014, | |
| "loss": 0.12400143146514893, | |
| "step": 75 | |
| }, | |
| { | |
| "epoch": 0.03149296329101466, | |
| "grad_norm": 0.07316447794437408, | |
| "learning_rate": 0.00013444444444444447, | |
| "loss": 0.04965262711048126, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.03346127349670308, | |
| "grad_norm": 0.05375482887029648, | |
| "learning_rate": 0.00012888888888888892, | |
| "loss": 0.05626271367073059, | |
| "step": 85 | |
| }, | |
| { | |
| "epoch": 0.0354295837023915, | |
| "grad_norm": 0.08668103069067001, | |
| "learning_rate": 0.00012333333333333334, | |
| "loss": 0.04172733426094055, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 0.03739789390807991, | |
| "grad_norm": 0.05760786682367325, | |
| "learning_rate": 0.00011777777777777779, | |
| "loss": 0.04003114104270935, | |
| "step": 95 | |
| }, | |
| { | |
| "epoch": 0.03936620411376833, | |
| "grad_norm": 0.07841235399246216, | |
| "learning_rate": 0.00011222222222222223, | |
| "loss": 0.05856711864471435, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.04133451431945675, | |
| "grad_norm": 0.08126020431518555, | |
| "learning_rate": 0.00010666666666666667, | |
| "loss": 0.07549648880958557, | |
| "step": 105 | |
| }, | |
| { | |
| "epoch": 0.04330282452514516, | |
| "grad_norm": 0.07693538069725037, | |
| "learning_rate": 0.00010111111111111112, | |
| "loss": 0.05478605628013611, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 0.04527113473083358, | |
| "grad_norm": 0.08111221343278885, | |
| "learning_rate": 9.555555555555557e-05, | |
| "loss": 0.042981699109077454, | |
| "step": 115 | |
| }, | |
| { | |
| "epoch": 0.047239444936522, | |
| "grad_norm": 0.059269264340400696, | |
| "learning_rate": 9e-05, | |
| "loss": 0.047053870558738706, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 0.04920775514221041, | |
| "grad_norm": 0.1270105242729187, | |
| "learning_rate": 8.444444444444444e-05, | |
| "loss": 0.04052863121032715, | |
| "step": 125 | |
| }, | |
| { | |
| "epoch": 0.05117606534789883, | |
| "grad_norm": 0.12631726264953613, | |
| "learning_rate": 4e-05, | |
| "loss": 0.03758008480072021, | |
| "step": 130 | |
| }, | |
| { | |
| "epoch": 0.053144375553587246, | |
| "grad_norm": 0.1927873194217682, | |
| "learning_rate": 9e-05, | |
| "loss": 0.04368264079093933, | |
| "step": 135 | |
| }, | |
| { | |
| "epoch": 0.055112685759275665, | |
| "grad_norm": 0.0689581036567688, | |
| "learning_rate": 0.00014, | |
| "loss": 0.049501892924308774, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 0.057080995964964076, | |
| "grad_norm": 0.10839821398258209, | |
| "learning_rate": 0.00019, | |
| "loss": 0.04906965792179108, | |
| "step": 145 | |
| }, | |
| { | |
| "epoch": 0.059049306170652495, | |
| "grad_norm": 0.09603235125541687, | |
| "learning_rate": 0.00019555555555555556, | |
| "loss": 0.032542136311531064, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 0.061017616376340914, | |
| "grad_norm": 0.12639078497886658, | |
| "learning_rate": 0.00019, | |
| "loss": 0.052462565898895266, | |
| "step": 155 | |
| }, | |
| { | |
| "epoch": 0.06298592658202933, | |
| "grad_norm": 0.07529020309448242, | |
| "learning_rate": 0.00018444444444444446, | |
| "loss": 0.03453230857849121, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 0.06495423678771775, | |
| "grad_norm": 0.07132653892040253, | |
| "learning_rate": 0.0001788888888888889, | |
| "loss": 0.035509389638900754, | |
| "step": 165 | |
| }, | |
| { | |
| "epoch": 0.06692254699340616, | |
| "grad_norm": 0.1096048653125763, | |
| "learning_rate": 0.00017333333333333334, | |
| "loss": 0.034902679920196536, | |
| "step": 170 | |
| }, | |
| { | |
| "epoch": 0.06889085719909457, | |
| "grad_norm": 0.13892512023448944, | |
| "learning_rate": 0.0001677777777777778, | |
| "loss": 0.046495720744132996, | |
| "step": 175 | |
| }, | |
| { | |
| "epoch": 0.070859167404783, | |
| "grad_norm": 0.07194061577320099, | |
| "learning_rate": 0.00016222222222222224, | |
| "loss": 0.09309906363487244, | |
| "step": 180 | |
| }, | |
| { | |
| "epoch": 0.07282747761047141, | |
| "grad_norm": 0.17113636434078217, | |
| "learning_rate": 0.00015666666666666666, | |
| "loss": 0.0954027771949768, | |
| "step": 185 | |
| }, | |
| { | |
| "epoch": 0.07479578781615982, | |
| "grad_norm": 0.06981978565454483, | |
| "learning_rate": 0.0001511111111111111, | |
| "loss": 0.030196136236190795, | |
| "step": 190 | |
| }, | |
| { | |
| "epoch": 0.07676409802184825, | |
| "grad_norm": 0.06941649317741394, | |
| "learning_rate": 0.00014555555555555556, | |
| "loss": 0.040055733919143674, | |
| "step": 195 | |
| }, | |
| { | |
| "epoch": 0.07873240822753666, | |
| "grad_norm": 0.06938308477401733, | |
| "learning_rate": 0.00014, | |
| "loss": 0.031933313608169554, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 0.08070468972983613, | |
| "grad_norm": 0.08689229935407639, | |
| "learning_rate": 4e-05, | |
| "loss": 0.06567999720573425, | |
| "step": 205 | |
| }, | |
| { | |
| "epoch": 0.0826730967964175, | |
| "grad_norm": 0.15433841943740845, | |
| "learning_rate": 9e-05, | |
| "loss": 0.08210374116897583, | |
| "step": 210 | |
| }, | |
| { | |
| "epoch": 0.08464150386299887, | |
| "grad_norm": 0.07927189767360687, | |
| "learning_rate": 0.00014, | |
| "loss": 0.08322054743766785, | |
| "step": 215 | |
| }, | |
| { | |
| "epoch": 0.08660991092958023, | |
| "grad_norm": 0.2075062394142151, | |
| "learning_rate": 0.00019, | |
| "loss": 0.05775731205940247, | |
| "step": 220 | |
| }, | |
| { | |
| "epoch": 0.0885783179961616, | |
| "grad_norm": 0.16508708894252777, | |
| "learning_rate": 0.0001998360655737705, | |
| "loss": 0.07884831428527832, | |
| "step": 225 | |
| } | |
| ], | |
| "logging_steps": 5, | |
| "max_steps": 4900, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 2, | |
| "save_steps": 25, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 1.511864096096379e+17, | |
| "train_batch_size": 2, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |