Instructions to use Nethermind/Mpt-Instruct-DotNet-XS with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nethermind/Mpt-Instruct-DotNet-XS with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nethermind/Mpt-Instruct-DotNet-XS", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Nethermind/Mpt-Instruct-DotNet-XS", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Nethermind/Mpt-Instruct-DotNet-XS with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nethermind/Mpt-Instruct-DotNet-XS" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nethermind/Mpt-Instruct-DotNet-XS", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Nethermind/Mpt-Instruct-DotNet-XS
- SGLang
How to use Nethermind/Mpt-Instruct-DotNet-XS 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 "Nethermind/Mpt-Instruct-DotNet-XS" \ --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": "Nethermind/Mpt-Instruct-DotNet-XS", "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 "Nethermind/Mpt-Instruct-DotNet-XS" \ --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": "Nethermind/Mpt-Instruct-DotNet-XS", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Nethermind/Mpt-Instruct-DotNet-XS with Docker Model Runner:
docker model run hf.co/Nethermind/Mpt-Instruct-DotNet-XS
File size: 1,075 Bytes
5df4390 | 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 40 41 42 43 44 45 46 | {
"alibi": true,
"alibi_bias_max": 8,
"architectures": [
"MosaicGPT"
],
"attn_clip_qkv": null,
"attn_impl": "torch",
"attn_pdrop": 0,
"attn_qk_ln": true,
"attn_uses_sequence_id": false,
"auto_map": {
"AutoConfig": "configuration_mosaic_gpt.MosaicGPTConfig",
"AutoModelForCausalLM": "mosaic_gpt.MosaicGPT"
},
"d_model": 2048,
"emb_init_std": null,
"emb_init_uniform_lim": null,
"emb_pdrop": 0,
"embedding_fraction": 1.0,
"fan_mode": "fan_in",
"init_device": "cpu",
"init_div_is_residual": true,
"init_gain": 0,
"init_nonlinearity": "relu",
"init_std": 0.02,
"logit_scale": null,
"low_precision_layernorm": true,
"max_seq_len": 2048,
"mlp_ratio": 4,
"model_type": "mosaic_gpt",
"n_heads": 16,
"n_layers": 24,
"no_bias": true,
"param_init_fn": "kaiming_normal_",
"prefix_lm": false,
"resid_pdrop": 0,
"softmax_scale": null,
"tokenizer_name": "EleutherAI/gpt-neox-20b",
"torch_dtype": "bfloat16",
"transformers_version": "4.33.0",
"use_cache": false,
"verbose": 0,
"vocab_size": 50432
}
|