Instructions to use snorkelai/Snorkel-Mistral-PairRM-DPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use snorkelai/Snorkel-Mistral-PairRM-DPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="snorkelai/Snorkel-Mistral-PairRM-DPO") 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("snorkelai/Snorkel-Mistral-PairRM-DPO") model = AutoModelForCausalLM.from_pretrained("snorkelai/Snorkel-Mistral-PairRM-DPO", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use snorkelai/Snorkel-Mistral-PairRM-DPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "snorkelai/Snorkel-Mistral-PairRM-DPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "snorkelai/Snorkel-Mistral-PairRM-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/snorkelai/Snorkel-Mistral-PairRM-DPO
- SGLang
How to use snorkelai/Snorkel-Mistral-PairRM-DPO 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 "snorkelai/Snorkel-Mistral-PairRM-DPO" \ --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": "snorkelai/Snorkel-Mistral-PairRM-DPO", "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 "snorkelai/Snorkel-Mistral-PairRM-DPO" \ --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": "snorkelai/Snorkel-Mistral-PairRM-DPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use snorkelai/Snorkel-Mistral-PairRM-DPO with Docker Model Runner:
docker model run hf.co/snorkelai/Snorkel-Mistral-PairRM-DPO
one gguf model
I ran llama cpp conversion to get a GGUF model to test on CPU
https://huggingface.co/andrew-cartwheel/snorkel-mistral-pairRM-DPO-q8_0.gguf
I ran llama cpp conversion to get a GGUF model to test on CPU
https://huggingface.co/andrew-cartwheel/snorkel-mistral-pairRM-DPO-q8_0.gguf
Hi Andrew,
Could you make 4Q M ver ?
If not could you at least gimme a formula on how to do this ? (Step by step as i completely have no idea how to do this)
Q8 is extremely slow .
Absolutely!
Here is a step by step guide https://github.com/ggerganov/llama.cpp/discussions/2948
Every step is outlined there, but if you run into trouble please let me know
Alternatively, it looks like another user uploaded more quants
https://huggingface.co/brittlewis12/Snorkel-Mistral-PairRM-DPO-GGUF/tree/main
Fantastic ! Thanks a lot !