Instructions to use junnyu/DeepScaleR-1.5B-Preview-Reproduce with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use junnyu/DeepScaleR-1.5B-Preview-Reproduce with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="junnyu/DeepScaleR-1.5B-Preview-Reproduce") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("junnyu/DeepScaleR-1.5B-Preview-Reproduce") model = AutoModelForCausalLM.from_pretrained("junnyu/DeepScaleR-1.5B-Preview-Reproduce") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use junnyu/DeepScaleR-1.5B-Preview-Reproduce with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "junnyu/DeepScaleR-1.5B-Preview-Reproduce" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "junnyu/DeepScaleR-1.5B-Preview-Reproduce", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/junnyu/DeepScaleR-1.5B-Preview-Reproduce
- SGLang
How to use junnyu/DeepScaleR-1.5B-Preview-Reproduce 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 "junnyu/DeepScaleR-1.5B-Preview-Reproduce" \ --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": "junnyu/DeepScaleR-1.5B-Preview-Reproduce", "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 "junnyu/DeepScaleR-1.5B-Preview-Reproduce" \ --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": "junnyu/DeepScaleR-1.5B-Preview-Reproduce", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use junnyu/DeepScaleR-1.5B-Preview-Reproduce with Docker Model Runner:
docker model run hf.co/junnyu/DeepScaleR-1.5B-Preview-Reproduce
question about training updates
Hello, thanks for the release of more training details of the deepscaler! However, I have a small question: Why does your checkpoint of the first stage show that it was trained for 560 steps rather than 1040 steps, as indicated by the author (https://github.com/agentica-project/deepscaler#:~:text=At%20step%201040%20and%201520%2C%20the%20context%20length%20is%20extended%20to%2016K%20and%2024K.)?
I am also reproducing the results of deepscaler, and have trained 680 steps (the ckpt dir indicating global_step_680) in the first stage. The training procedure is still going on. Moreover, no training log indicates how many updates have been trained. I wonder if I have to manually stop the procedure and when I should do.
主要是因为我发现这个step的test score更高(是个转折点,response的最小和平均长度在这个步数开始发生转折,持续增长),于是我就选择了这个560步进一步进行训练