Instructions to use cpral/Nex-N2-Pro-EXL3-2BPW with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cpral/Nex-N2-Pro-EXL3-2BPW with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cpral/Nex-N2-Pro-EXL3-2BPW") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("cpral/Nex-N2-Pro-EXL3-2BPW") model = AutoModelForMultimodalLM.from_pretrained("cpral/Nex-N2-Pro-EXL3-2BPW") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cpral/Nex-N2-Pro-EXL3-2BPW with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cpral/Nex-N2-Pro-EXL3-2BPW" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cpral/Nex-N2-Pro-EXL3-2BPW", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cpral/Nex-N2-Pro-EXL3-2BPW
- SGLang
How to use cpral/Nex-N2-Pro-EXL3-2BPW 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 "cpral/Nex-N2-Pro-EXL3-2BPW" \ --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": "cpral/Nex-N2-Pro-EXL3-2BPW", "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 "cpral/Nex-N2-Pro-EXL3-2BPW" \ --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": "cpral/Nex-N2-Pro-EXL3-2BPW", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use cpral/Nex-N2-Pro-EXL3-2BPW with Docker Model Runner:
docker model run hf.co/cpral/Nex-N2-Pro-EXL3-2BPW
Configuration Parsing Warning:In config.json: "quantization_config.bits" must be an integer
2BPW EXL3 quant of Nex-N2-Pro 397B.
-- A perplexity: 3.27149317
-- B perplexity: 3.62310984
-- A label in top-K:
K = 1: 0.7133
K = 2: 0.8114
K = 3: 0.8532
K = 4: 0.8767
K = 5: 0.8924
-- B label in top-K:
K = 1: 0.6874
K = 2: 0.7958
K = 3: 0.8399
K = 4: 0.8663
K = 5: 0.8840
-- Top-K agreement, A vs B:
K = 1: 0.8709
K = 2: 0.5901
K = 3: 0.3424
K = 4: 0.1836
K = 5: 0.0948
-- KL divergence (A, B): 0.22048885
-- KL divergence (B, A): 0.16824008
- Downloads last month
- 21
Model tree for cpral/Nex-N2-Pro-EXL3-2BPW
Base model
nex-agi/Nex-N2-Pro