Text Generation
Transformers
Safetensors
English
llama
spp
synthetic-persona-pretraining
alignment
safety
conversational
text-generation-inference
Instructions to use dlab-spp/mt-3b-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dlab-spp/mt-3b-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dlab-spp/mt-3b-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dlab-spp/mt-3b-instruct") model = AutoModelForCausalLM.from_pretrained("dlab-spp/mt-3b-instruct", device_map="auto") 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 Settings
- vLLM
How to use dlab-spp/mt-3b-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dlab-spp/mt-3b-instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dlab-spp/mt-3b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dlab-spp/mt-3b-instruct
- SGLang
How to use dlab-spp/mt-3b-instruct 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 "dlab-spp/mt-3b-instruct" \ --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": "dlab-spp/mt-3b-instruct", "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 "dlab-spp/mt-3b-instruct" \ --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": "dlab-spp/mt-3b-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use dlab-spp/mt-3b-instruct with Docker Model Runner:
docker model run hf.co/dlab-spp/mt-3b-instruct
File size: 937 Bytes
5424ea3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | {
"<assistant>": 49152,
"<charter_1.1>": 49153,
"<charter_1.2>": 49154,
"<charter_1.3>": 49155,
"<charter_1.4>": 49156,
"<charter_1.5>": 49157,
"<charter_2.1>": 49158,
"<charter_2.2>": 49159,
"<charter_2.3>": 49160,
"<charter_2.4>": 49161,
"<charter_2.5>": 49162,
"<charter_2.6>": 49163,
"<charter_2.7>": 49164,
"<charter_2.8>": 49165,
"<charter_3.1>": 49166,
"<charter_3.2>": 49167,
"<charter_3.3>": 49168,
"<charter_3.4>": 49169,
"<charter_3.5>": 49170,
"<charter_3.6>": 49171,
"<charter_4.1>": 49172,
"<charter_4.2>": 49173,
"<charter_4.3>": 49174,
"<charter_4.4>": 49175,
"<charter_4.5>": 49176,
"<charter_4.6>": 49177,
"<charter_5.1>": 49178,
"<charter_5.2>": 49179,
"<charter_5.3>": 49180,
"<charter_5.4>": 49181,
"<charter_5.5>": 49182,
"<charter_5.6>": 49183,
"<charter_6.1>": 49184,
"<charter_6.2>": 49185,
"<charter_6.3>": 49186,
"<charter_6.4>": 49187
}
|