Text Generation
Transformers
PyTorch
English
mpt
csharp
instruct
7b
llm
.net
custom_code
text-generation-inference
Instructions to use Nethermind/Mpt-Instruct-DotNet-S with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nethermind/Mpt-Instruct-DotNet-S with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nethermind/Mpt-Instruct-DotNet-S", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nethermind/Mpt-Instruct-DotNet-S", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("Nethermind/Mpt-Instruct-DotNet-S", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nethermind/Mpt-Instruct-DotNet-S 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-S" # 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-S", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Nethermind/Mpt-Instruct-DotNet-S
- SGLang
How to use Nethermind/Mpt-Instruct-DotNet-S 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-S" \ --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-S", "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-S" \ --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-S", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Nethermind/Mpt-Instruct-DotNet-S with Docker Model Runner:
docker model run hf.co/Nethermind/Mpt-Instruct-DotNet-S
Commit History
-
Adding `safetensors` variant of this model
Verified signatureThis is an automated PR created with https://huggingface.co/spaces/safetensors/convert This new file is equivalent to `pytorch_model.bin` but safe in the sense that no arbitrary code can be put into it. These files also happen to load much faster than their pytorch counterpart: https://colab.research.google.com/github/huggingface/notebooks/blob/main/safetensors_doc/en/speed.ipynb The widgets on your model page will run using this model even if this is not merged making sure the file actually works. If you find any issues: please report here: https://huggingface.co/spaces/safetensors/convert/discussions Feel free to ignore this PR.3016999
-
Update README.md
5eda52c
-
Update README.md
940b52e -
Update README.md
2af8994 -
Update README.md
df12094 -
Update README.md
To play with it in pytorch or GGML/.Net [start here](https://github.com/NethermindEth/Mpt-Instruct-DotNet-S) ## Training Finetuned for CSharp [mosaicml/mpt-7b-instruct](https://huggingface.co/mosaicml/mpt-7b-instruct). Max context length is restricted to 1024 tokens. 'Loss': 0.256045166015625 on 300k CSharp-related records 'Loss': 0.095714599609375 on 50k specific short prompts ## Sources data contained (most data was around 500 tokens long < 1000, except large code files): - codeparrot/github-code C# ("mit", "Apache-2.0", "Bsd-3-clause", "Bsd-2-clause", "Cc0-1.0", "Unlicense", "isc") - raw data Plain .cs files randomly cut at the 60-80% in the instruction, and we ask the network to continue last 40-20% (76k) - documented static functions 72k - SO 5q_5answer + 5q_5best (CC BY-SA 4.0) 70k - Dotnet wiki (30k, rendered out from [github repo](https://github.com/microsoft/dotnet), see also removed, GPT-4 generated short question to each file) - All NM Static Functions and Tests (from [ne…fec5b7e
-
Model trained on 300k CSharp related instructions and extra tuned on 50k specific GPT generated short ones
## Training Finetuned for CSharp [mosaicml/mpt-7b-instruct](https://huggingface.co/mosaicml/mpt-7b-instruct). Max context length is restricted to 1024 tokens. 'Loss': 0.256045166015625 on 300k CSharp-related records 'Loss': 0.095714599609375 on 50k specific short prompts ## Sources data contained (most data was around 500 tokens long < 1000, except large code files): - codeparrot/github-code C# ("mit", "Apache-2.0", "Bsd-3-clause", "Bsd-2-clause", "Cc0-1.0", "Unlicense", "isc") - raw data Plain .cs files randomly cut at the 60-80% in the instruction, and we ask the network to continue last 40-20% (76k) - documented static functions 72k - SO 5q_5answer + 5q_5best (CC BY-SA 4.0) 70k - Dotnet wiki (30k, rendered out from [github repo](https://github.com/microsoft/dotnet), see also removed, GPT-4 generated short question to each file) - All NM Static Functions and Tests (from [nethermind client repo](https://github.com/NethermindEth/nethermind) documented and descri…3a32033 -
initial commit
15e9306