Instructions to use rostlabs/rost-1b-instruct-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rostlabs/rost-1b-instruct-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rostlabs/rost-1b-instruct-v2", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("rostlabs/rost-1b-instruct-v2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rostlabs/rost-1b-instruct-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rostlabs/rost-1b-instruct-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rostlabs/rost-1b-instruct-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rostlabs/rost-1b-instruct-v2
- SGLang
How to use rostlabs/rost-1b-instruct-v2 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 "rostlabs/rost-1b-instruct-v2" \ --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": "rostlabs/rost-1b-instruct-v2", "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 "rostlabs/rost-1b-instruct-v2" \ --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": "rostlabs/rost-1b-instruct-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rostlabs/rost-1b-instruct-v2 with Docker Model Runner:
docker model run hf.co/rostlabs/rost-1b-instruct-v2
Packaging: token IDs, raw checkpoint, nanochat tokenizer
Browse filesgeneration_config.json sets only bos/eos/pad, read from this repository's own tokenizer rather than copied from v1. No decoding parameters are prescribed: no tested configuration satisfied the preregistered gate of zero looping and zero token-cap endings across all six repetition-stress prompts, so the repository declines to recommend one. Transformers therefore defaults to greedy, which did not pass the gate either -- it is what prescribing nothing leaves.
Without an eos_token_id, generate() has no stop condition and runs to max_new_tokens on every call; that is the regression this file prevents. Both the assistant-end token and bos are listed, because the model emits either to end a turn.
Also adds the raw training checkpoint and the nanochat tokenizer artifacts, matching v1's layout. No weight file is touched: model.safetensors is unchanged from revision 2250a44c.
- generation_config.json +9 -0
- meta_000365.json +63 -0
- model_000365.pt +3 -0
- tokenizer/token_bytes.pt +3 -0
- tokenizer/tokenizer.pkl +3 -0
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": false,
|
| 3 |
+
"bos_token_id": 32759,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
32763,
|
| 6 |
+
32759
|
| 7 |
+
],
|
| 8 |
+
"pad_token_id": 32763
|
| 9 |
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"step": 365,
|
| 3 |
+
"val_bpb": null,
|
| 4 |
+
"model_config": {
|
| 5 |
+
"sequence_len": 4096,
|
| 6 |
+
"vocab_size": 32768,
|
| 7 |
+
"n_layer": 24,
|
| 8 |
+
"n_head": 12,
|
| 9 |
+
"n_kv_head": 12,
|
| 10 |
+
"n_embd": 1536,
|
| 11 |
+
"window_pattern": "SSSL",
|
| 12 |
+
"rope_base": 100000
|
| 13 |
+
},
|
| 14 |
+
"user_config": {
|
| 15 |
+
"run": "rost-sft-v2-C-145M-dbs8-ga2",
|
| 16 |
+
"mixture": "smoltalk",
|
| 17 |
+
"identity_name": "rost",
|
| 18 |
+
"device_type": "cuda",
|
| 19 |
+
"compile_mode": "default",
|
| 20 |
+
"serial_compile_warmup": true,
|
| 21 |
+
"eager_optimizer": true,
|
| 22 |
+
"init_source": "base",
|
| 23 |
+
"model_tag": "d24",
|
| 24 |
+
"model_step": 11136,
|
| 25 |
+
"output_model_tag": "sft-v2-C",
|
| 26 |
+
"load_optimizer": 1,
|
| 27 |
+
"plan_dir": "/home/devops/sft-v2-launch-v6-145M/plan_C",
|
| 28 |
+
"plan_origin_root": "/home/devops",
|
| 29 |
+
"plan_filtered_root": "/home/devops/sft-v2-filtered-v2",
|
| 30 |
+
"plan_start_step": 1,
|
| 31 |
+
"plan_diagnostic_run": false,
|
| 32 |
+
"num_iterations": -1,
|
| 33 |
+
"max_seq_len": 4096,
|
| 34 |
+
"device_batch_size": 8,
|
| 35 |
+
"total_batch_size": 524288,
|
| 36 |
+
"embedding_lr": 0.3,
|
| 37 |
+
"unembedding_lr": 0.008,
|
| 38 |
+
"matrix_lr": 0.02,
|
| 39 |
+
"init_lr_frac": 0.8,
|
| 40 |
+
"warmup_ratio": 0.0,
|
| 41 |
+
"warmdown_ratio": 0.5,
|
| 42 |
+
"final_lr_frac": 0.0,
|
| 43 |
+
"grad_clip": 0.0,
|
| 44 |
+
"eval_every": -1,
|
| 45 |
+
"eval_tokens": 20971520,
|
| 46 |
+
"save_every": 100,
|
| 47 |
+
"eval_device_batch_size": -1,
|
| 48 |
+
"chatcore_batch_size": -1,
|
| 49 |
+
"eval_oom_policy": "contain",
|
| 50 |
+
"chatcore_every": -1,
|
| 51 |
+
"chatcore_max_cat": -1,
|
| 52 |
+
"chatcore_max_sample": 24,
|
| 53 |
+
"dialogue_frac": 0.0,
|
| 54 |
+
"english_frac": 0.0,
|
| 55 |
+
"ro_gsm8k_epochs": 0,
|
| 56 |
+
"agent_traces": null,
|
| 57 |
+
"agent_epochs": 1,
|
| 58 |
+
"agent_frac": 0.0,
|
| 59 |
+
"agent_max_repeats": 1000,
|
| 60 |
+
"mmlu_epochs": 3,
|
| 61 |
+
"gsm8k_epochs": 4
|
| 62 |
+
}
|
| 63 |
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:397dcd5264e2e0dafadd20da3726d8105cafb0becf43ced607d1cd721b0df121
|
| 3 |
+
size 4227935530
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:30d116ce754dedb997736932f5f3c09421f9acfa4d69c81b84ad88d8d52776c4
|
| 3 |
+
size 132677
|
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4b7fa31fb8663860349da7d4c86ebef456b495748c1899fd243024b9fcfef7f8
|
| 3 |
+
size 414480
|