Instructions to use TheBloke/Mistral-7B-OpenOrca-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheBloke/Mistral-7B-OpenOrca-GPTQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TheBloke/Mistral-7B-OpenOrca-GPTQ", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TheBloke/Mistral-7B-OpenOrca-GPTQ") model = AutoModelForCausalLM.from_pretrained("TheBloke/Mistral-7B-OpenOrca-GPTQ", 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 TheBloke/Mistral-7B-OpenOrca-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TheBloke/Mistral-7B-OpenOrca-GPTQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TheBloke/Mistral-7B-OpenOrca-GPTQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TheBloke/Mistral-7B-OpenOrca-GPTQ
- SGLang
How to use TheBloke/Mistral-7B-OpenOrca-GPTQ 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 "TheBloke/Mistral-7B-OpenOrca-GPTQ" \ --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": "TheBloke/Mistral-7B-OpenOrca-GPTQ", "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 "TheBloke/Mistral-7B-OpenOrca-GPTQ" \ --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": "TheBloke/Mistral-7B-OpenOrca-GPTQ", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TheBloke/Mistral-7B-OpenOrca-GPTQ with Docker Model Runner:
docker model run hf.co/TheBloke/Mistral-7B-OpenOrca-GPTQ
IndexError: Out of range: piece id is out of range
Using Exllama & Exllamav2 I get the following error with this model in the Text-generation-webui
Traceback (most recent call last):
File "C:\AI\text-generation-webui\modules\text_generation.py", line 384, in generate_reply_custom
for reply in shared.model.generate_with_streaming(question, state):
File "C:\AI\text-generation-webui\modules\exllamav2.py", line 119, in generate_with_streaming
decoded_text = self.tokenizer.decode(ids[:, initial_len:])[0]
File "C:\AI\text-generation-webui\installer_files\env\lib\site-packages\exllamav2\tokenizer.py", line 92, in decode
texts.append(self.tokenizer.Decode(seq))
File "C:\AI\text-generation-webui\installer_files\env\lib\site-packages\sentencepiece_init_.py", line 780, in Decode
return self.DecodeIds(input)
File "C:\AI\text-generation-webui\installer_files\env\lib\site-packages\sentencepiece_init.py", line 337, in _DecodeIds
return _sentencepiece.SentencePieceProcessor__DecodeIds(self, ids)
IndexError: Out of range: piece id is out of range.
Output generated in 4.94 seconds (53.20 tokens/s, 263 tokens, context 1071, seed 587620518)
Same issue here, the error is coming from the sentencepiece library, perhaps something with the vocabulary size isn't set correctly.
Is that related to this at all? Traceback (most recent call last):
File "c:\Users\Scott\VSC_Source\LLM_DB\EXLLAMAv2y production.py", line 181, in
output = generator.generate_simple(prompt,settings,max_new_tokens)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Scott\anaconda3\envs\ELLAMA\Lib\site-packages\exllamav2\generator\base.py", line 60, in generate_simple
token, _ = ExLlamaV2Sampler.sample(logits, gen_settings, self.sequence_ids, random.random())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Scott\anaconda3\envs\ELLAMA\Lib\site-packages\exllamav2\generator\sampler.py", line 63, in sample
if settings.token_bias is not None: logits += settings.token_bias
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: The size of tensor a (32032) must match the size of tensor b (32002) at non-singleton dimension 1