Instructions to use Locutusque/TinyMistral-248M-v2-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Locutusque/TinyMistral-248M-v2-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Locutusque/TinyMistral-248M-v2-Instruct")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Locutusque/TinyMistral-248M-v2-Instruct") model = AutoModelForCausalLM.from_pretrained("Locutusque/TinyMistral-248M-v2-Instruct", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Locutusque/TinyMistral-248M-v2-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Locutusque/TinyMistral-248M-v2-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Locutusque/TinyMistral-248M-v2-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Locutusque/TinyMistral-248M-v2-Instruct
- SGLang
How to use Locutusque/TinyMistral-248M-v2-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 "Locutusque/TinyMistral-248M-v2-Instruct" \ --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": "Locutusque/TinyMistral-248M-v2-Instruct", "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 "Locutusque/TinyMistral-248M-v2-Instruct" \ --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": "Locutusque/TinyMistral-248M-v2-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Locutusque/TinyMistral-248M-v2-Instruct with Docker Model Runner:
docker model run hf.co/Locutusque/TinyMistral-248M-v2-Instruct
Commit History
-
Set `add_bos_token` to `false` to prevent auto-adding `<|bos|>` in prompts from GGUF files (#3)
Verified signature- Set `add_bos_token` to `false` to prevent auto-adding `<|bos|>` in prompts from GGUF files (9d0cf2b7103bc46fcdf22c1b8fc94ebf5720c8cd) Co-authored-by: Victor Nogueira <Felladrin@users.noreply.huggingface.co>e1d2b43
-
Adding `safetensors` variant of this model (#1)
Verified signature- Adding `safetensors` variant of this model (ded504e4b51c45532da625afefdd24e07b728cf9) Co-authored-by: Safetensors convertbot <SFconvertbot@users.noreply.huggingface.co>4b5d362
-
Update README.md
Verified signaturea2642bb -
Update README.md
Verified signature039b58f -
Update README.md
Verified signature76f32ef -
Update README.md
Verified signature1b1b98d -
Delete trainer_state.json
Verified signaturebb57997 -
Create README.md
Verified signaturec12aeae -
checkpoint-3000
Verified signature0f235a2 -
initial commit
Verified signature019504e