Run this model with HF Jobs
Run instruction-pretrain/InstructLM-1.3B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/instruction-pretrain/InstructLM-1.3B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/instruction-pretrain/InstructLM-1.3B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/instruction-pretrain/InstructLM-1.3B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/instruction-pretrain/InstructLM-1.3B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use instruction-pretrain/InstructLM-1.3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use instruction-pretrain/InstructLM-1.3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="instruction-pretrain/InstructLM-1.3B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("instruction-pretrain/InstructLM-1.3B") model = AutoModelForCausalLM.from_pretrained("instruction-pretrain/InstructLM-1.3B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use instruction-pretrain/InstructLM-1.3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "instruction-pretrain/InstructLM-1.3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "instruction-pretrain/InstructLM-1.3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/instruction-pretrain/InstructLM-1.3B
- SGLang
How to use instruction-pretrain/InstructLM-1.3B 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 "instruction-pretrain/InstructLM-1.3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "instruction-pretrain/InstructLM-1.3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "instruction-pretrain/InstructLM-1.3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "instruction-pretrain/InstructLM-1.3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use instruction-pretrain/InstructLM-1.3B with Docker Model Runner:
docker model run hf.co/instruction-pretrain/InstructLM-1.3B
Thanks for the models and data, I have some questions.
hi,
I would like to know what template they have trained you in (chatml?)
Training time, was it training with Lora or complete?
thank you so much
Hi,
Thanks for your interest!
Template
Since we are training a base model instead of a chat model, we use a wide range of templates to diversify the format. We utilize templates from the Flan collection to diversify instruction-response pairs and templates from AdaptLLM to concatenate the raw text (context) with downstream instruction-response pairs. We are currently working on open-sourcing the code for templifying the data, so please stay tuned!
Training Settings
For pre-training, we train on all parameters. The training time for Instruction Pre-training is the same as Vanilla Pre-training. We present the training details in Table 10 in Appendix, where we train the 500M model for 5 days and the 1.3B model for 10 days.
Hi, For pre-training, are you split and concatenate all samples to max sequence length?
Hi, we follow the same settings as GPT-3: packing multiple examples into one sequence until the max sequence length is reached. Each example is a one/few-shot instruction-augmented text.
Hi, we follow the same settings as GPT-3: packing multiple examples into one sequence until the max sequence length is reached. Each example is a one/few-shot instruction-augmented text.
Thank you for your reply! Another question is: as for Mix PT expriment, this means mixing raw docs with the SFT data used to fine-tuning instruction synthesizer? How about mix raw docs with the instruction datas generated by instruction synthesizer?
Hi, "mixing raw docs with the instruction data generated by the instruction synthesizer" is exactly what we did in the general pre-training from scratch, as described in section 2.2:
"Considering the large amount of data required for general pre-training from scratch, we only convert part of the raw corpora into instruction-augmented corpora, leaving the rest unchanged. Additionally, we mix the corpora with the data used for fine-tuning the instruction synthesizer to enhance task diversity."
For instance, if there are N raw texts, we may convert 1/5 of them into instruction-augmented texts, leaving the remaining 4/5 unchanged. We also mix these with the SFT data used for fine-tuning the instruction synthesizer .
