Image-Text-to-Text
Transformers
Safetensors
qwen2_5_vl
conversational
text-generation-inference
compressed-tensors
Instructions to use ig1/NuExtract-2.0-8B-FP8-Dynamic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ig1/NuExtract-2.0-8B-FP8-Dynamic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ig1/NuExtract-2.0-8B-FP8-Dynamic") 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("ig1/NuExtract-2.0-8B-FP8-Dynamic") model = AutoModelForMultimodalLM.from_pretrained("ig1/NuExtract-2.0-8B-FP8-Dynamic", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ig1/NuExtract-2.0-8B-FP8-Dynamic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ig1/NuExtract-2.0-8B-FP8-Dynamic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ig1/NuExtract-2.0-8B-FP8-Dynamic", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/ig1/NuExtract-2.0-8B-FP8-Dynamic
- SGLang
How to use ig1/NuExtract-2.0-8B-FP8-Dynamic 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 "ig1/NuExtract-2.0-8B-FP8-Dynamic" \ --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": "ig1/NuExtract-2.0-8B-FP8-Dynamic", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "ig1/NuExtract-2.0-8B-FP8-Dynamic" \ --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": "ig1/NuExtract-2.0-8B-FP8-Dynamic", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use ig1/NuExtract-2.0-8B-FP8-Dynamic with Docker Model Runner:
docker model run hf.co/ig1/NuExtract-2.0-8B-FP8-Dynamic
| license: mit | |
| library_name: transformers | |
| pipeline_tag: image-text-to-text | |
| base_model: | |
| - numind/NuExtract-2.0-8B | |
| # NuExtract-2.0-8B-FP8-Dynamic | |
| ## Quantization | |
| Quantized with [llm-compressor](https://github.com/vllm-project/llm-compressor) v0.9.0.1. | |
| We used the original [qwen2.5-vl example compression script](https://github.com/vllm-project/llm-compressor/blob/main/examples/multimodal_vision/qwen_2_5_vl_example.py) and adapted it to a [FP8-Dynamic compression recipe](https://github.com/vllm-project/llm-compressor/tree/main/examples/quantization_w8a8_fp8). | |
| ## vLLM inference | |
| ```bash | |
| docker run --rm --name 'NuExtract-2.0-8B' -e HF_TOKEN -v '/srv/cache:/root/.cache' -p 8000:8000 -e LD_LIBRARY_PATH='/lib/x86_64-linux-gnu:/usr/local/cuda/lib64' 'vllm/vllm-openai:v0.15.1-cu130' 'ig1/NuExtract-2.0-8B-FP8-Dynamic' --served-model-name 'NuExtract-2.0-8B' --trust-remote-code --limit-mm-per-prompt '{"image": 6, "video": 0}' --chat-template-content-format 'openai' --max-model-len 'auto' --kv-cache-memory-bytes '7G' | |
| ``` | |
| * `-e LD_LIBRARY_PATH=/lib64:/usr/local/cuda/lib64` is only needed if your host have a recent driver version (with native CUDA 13.0 or 13.1). See [#32373](https://github.com/vllm-project/vllm/issues/32373) for more info. | |
| * Adapt `/srv/cache` to your liking, this will contains all cache data you want to keep for faster startup: | |
| * dirs like `huggingface`, `torch`, `vllm`, `flashinfer`, etc... | |
| * To avoid eating up all the GPU VRAM, the `--kv-cache-memory-bytes '7G'` is set (it allows max model len by 1.02x) | |
| * Feel free to adjust (or remove the flag and switch back to `--gpu-memory-utilization 0.9`) to increase or decrease KV cache to your liking | |
| Check original project readme for openai like chat template use in requests. |