Instructions to use Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS") model = AutoModelForCausalLM.from_pretrained("Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS
- SGLang
How to use Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS 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 "Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS" \ --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": "Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS", "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 "Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS" \ --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": "Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS with Docker Model Runner:
docker model run hf.co/Kooten/Mistral-Nemo-Instruct-2407-norefuse-OAS
Getting a ValueError upon loading the model, tensors are not matching.
Getting this problem whenever I load it with Transformers with oobabooga. Am I missing something to load it?
"ValueError: Trying to set a tensor of shape torch.Size([1024, 5120]) in "weight" (which has shape torch.Size([1280, 5120])), this look incorrect."
You need to update transformers
run cmd_windows.bat and then you run pip install git+https://github.com/huggingface/transformers.git -U
this will update transformers and allow you to run the model.
Yes, thank you. It's working but it's pretty slow, around 2.32 t/s. I am running it on a 3090, so I guess it has to do with my config.
I get about 5t/s with load-in-8bit, might be overflowing in to ram for you
I'm uploading an exllama version in a few minutes, that gives me about 50t/s at 6.5bpw