Text Generation
Transformers
PyTorch
Safetensors
mistral
finetuned
mistral-common
conversational
Eval Results
text-generation-inference
Instructions to use mistralai/Mistral-7B-Instruct-v0.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mistralai/Mistral-7B-Instruct-v0.2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mistralai/Mistral-7B-Instruct-v0.2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2") model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2", 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mistralai/Mistral-7B-Instruct-v0.2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Install mistral-common: pip install --upgrade mistral-common # Start the vLLM server: vllm serve "mistralai/Mistral-7B-Instruct-v0.2" --tokenizer_mode mistral --config_format mistral --load_format mistral --tool-call-parser mistral --enable-auto-tool-choice # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mistralai/Mistral-7B-Instruct-v0.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mistralai/Mistral-7B-Instruct-v0.2
- SGLang
How to use mistralai/Mistral-7B-Instruct-v0.2 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 "mistralai/Mistral-7B-Instruct-v0.2" \ --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": "mistralai/Mistral-7B-Instruct-v0.2", "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 "mistralai/Mistral-7B-Instruct-v0.2" \ --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": "mistralai/Mistral-7B-Instruct-v0.2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use mistralai/Mistral-7B-Instruct-v0.2 with Docker Model Runner:
docker model run hf.co/mistralai/Mistral-7B-Instruct-v0.2
Request: DOI
#176 opened over 1 year ago
by
Ash444
Update README.md
#174 opened over 1 year ago
by
Matko1969
The model mistralai/Mistral-7B-Instruct-v0.2 is too large to be loaded automatically (14GB > 10GB).
👀 1
1
#173 opened over 1 year ago
by
him03
403 Client Error
#171 opened over 1 year ago
by
TriboSymbolicAI
Request: DOI
#170 opened over 1 year ago
by
notsanyam
READ ME:
#169 opened over 1 year ago
by
TriboSymbolicAI
Example code in README.md doesn't work
#168 opened over 1 year ago
by
johnucm
Request: DOI
#167 opened over 1 year ago
by
5hivan5h
Update README.md
#166 opened over 1 year ago
by
AlejandroPCA
Request: DOI
#165 opened over 1 year ago
by
Raiff1982
running this model in inf2 8x throw assertion error
#164 opened over 1 year ago
by
Arun63
update inference with transformers
👀 3
#162 opened almost 2 years ago
by
AzizBelaweid
Cannot import name 'BitsAndBytesConfig' from 'bitsandbytes'
1
#160 opened almost 2 years ago
by
VAISHAKHAN
Unable to Access Mistral-7B-Instruct-v0.2 Model
➕👍 4
5
#159 opened almost 2 years ago
by
charudatta-17
Service Unavailable
9
#158 opened almost 2 years ago
by
Daswahre
On-demand answers available? [guardrailing]
#156 opened almost 2 years ago
by
Quetzalcoatl-homotopy
Where is mistralai/Mistral-7B-v0.2
1
#155 opened about 2 years ago
by
raghavlite
error when load mistralai/Mistral-7B-Instruct-v0.2
1
#154 opened about 2 years ago
by
Mahnaz90
Rename README.md to resolve
#153 opened about 2 years ago
by
mohammedallamai
Update README.md
#152 opened about 2 years ago
by
mohammedallamai
which file to use on comfyui local LLM
1
#151 opened about 2 years ago
by
sss251
responses are incomplete, greetings are not handled
5
#150 opened about 2 years ago
by
dev4sidra
Encountering KeyError: 'mistral' on GPUs for Inference
1
#148 opened about 2 years ago
by
ratnopam
Request: DOI
#147 opened about 2 years ago
by
Martha00100
How do I get streaming token generation from mistral_common? Example needed
#146 opened about 2 years ago
by
narai
Failed to download tokenizer mistralai/Mistral-7B-Instruct-v0.2. Falling back to default tokenizer
1
#145 opened about 2 years ago
by
didiaodeking
Update README.md
#144 opened about 2 years ago
by
pandora-s
Last nights update to tokenizer files broke my tool
➕👍 11
18
#143 opened about 2 years ago
by
devenv571
Mistral-7B-Instruct-v0.2 model reading issue when using Transformer imported from mistral_inference.model
2
#142 opened about 2 years ago
by
EnRaoufi
infinite empty token generation
#139 opened about 2 years ago
by
suchaudn
Greetings are not handled properly
7
#135 opened about 2 years ago
by
fayazvaluelabs
pgpt
#134 opened about 2 years ago
by
TheDogeBird
Update config.json
#133 opened about 2 years ago
by
Jacoboooooooo
Does anyone have a maximum output length for this model?
#132 opened about 2 years ago
by
anshumankmr
Issue with Keyword-Based Queries in RAG Chatbot Using Vector Database
1
#131 opened about 2 years ago
by
rishik10
cuong
#130 opened about 2 years ago
by
cuonggachoi
Model repeating prompt and not learning eos token
👍👀 3
1
#129 opened over 2 years ago
by
Essacheez
Upload train-00000-of-00001-2bca7743b5756e17.parquet
#128 opened over 2 years ago
by
MasterDee
Tryint to use private-gpt with Mistral but not having access to model
3
#127 opened over 2 years ago
by
hitoruna
Japanese Version
#126 opened over 2 years ago
by
ahsanr
Hardware requirements
1
#125 opened over 2 years ago
by
AnikaTaggd
Issue You must be authenticated to access it in Pycharm
6
#124 opened over 2 years ago
by
Davidfer066
Mistral-7b pre-trained on French
#123 opened over 2 years ago
by
icpro
Mistral 7B Instruct v0.2 when trained with lora adapters is giving output without spaces.
#122 opened over 2 years ago
by
Xlar
Correct format for fine-tuning
2
#121 opened over 2 years ago
by
engrzulqarnain
libcudart.so.11.0: cannot open shared object file: No such file or directory
#119 opened over 2 years ago
by
ophir
External API
#118 opened over 2 years ago
by
sirajudeen26