Text Generation
Transformers
English
multilingual
inkling2_loop
image-text-to-text
prime-quant
2-bit
4-bit precision
Mixture of Experts
inkling-2
inkling-2-mini
looped-transformer
triton
rocm
cuda
quantization
coding
conversational
Instructions to use batteryphil/Inkling-2-Mini-PRIME-Quant with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use batteryphil/Inkling-2-Mini-PRIME-Quant with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="batteryphil/Inkling-2-Mini-PRIME-Quant") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("batteryphil/Inkling-2-Mini-PRIME-Quant") model = AutoModelForMultimodalLM.from_pretrained("batteryphil/Inkling-2-Mini-PRIME-Quant", device_map="auto") 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use batteryphil/Inkling-2-Mini-PRIME-Quant with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "batteryphil/Inkling-2-Mini-PRIME-Quant" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "batteryphil/Inkling-2-Mini-PRIME-Quant", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/batteryphil/Inkling-2-Mini-PRIME-Quant
- SGLang
How to use batteryphil/Inkling-2-Mini-PRIME-Quant 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 "batteryphil/Inkling-2-Mini-PRIME-Quant" \ --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": "batteryphil/Inkling-2-Mini-PRIME-Quant", "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 "batteryphil/Inkling-2-Mini-PRIME-Quant" \ --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": "batteryphil/Inkling-2-Mini-PRIME-Quant", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use batteryphil/Inkling-2-Mini-PRIME-Quant with Docker Model Runner:
docker model run hf.co/batteryphil/Inkling-2-Mini-PRIME-Quant
File size: 1,181 Bytes
53ce2f5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | {
"checkpoint": "/data/prime_quant_models/inkling2_mini_p2_looptop8.safetensors",
"disk_gb": 10.868,
"vram_gb": 10.867,
"total_tokens": 1849,
"mean_kld": 0.0542,
"top1_pct": 93.35,
"ref_ppl": 2.1416,
"q_ppl": 2.1542,
"delta_loss": 0.00586,
"domains": {
"python_code": {
"n_tokens": 521,
"ref_ppl": 1.3042,
"q_ppl": 1.319,
"delta_loss": 0.0113,
"mean_kld": 0.02169,
"top1_pct": 97.5
},
"systems_cpp": {
"n_tokens": 419,
"ref_ppl": 1.2216,
"q_ppl": 1.2525,
"delta_loss": 0.02501,
"mean_kld": 0.01806,
"top1_pct": 97.61
},
"math_reasoning": {
"n_tokens": 390,
"ref_ppl": 1.7601,
"q_ppl": 1.8209,
"delta_loss": 0.03397,
"mean_kld": 0.04371,
"top1_pct": 93.59
},
"technical_prose": {
"n_tokens": 216,
"ref_ppl": 6.9495,
"q_ppl": 7.6525,
"delta_loss": 0.09637,
"mean_kld": 0.10205,
"top1_pct": 83.33
},
"inkling_chat_tool": {
"n_tokens": 303,
"ref_ppl": 6.0739,
"q_ppl": 5.33,
"delta_loss": -0.13065,
"mean_kld": 0.13945,
"top1_pct": 87.13
}
}
} |