Image-Text-to-Text
Safetensors
qwen3_5
quantization
auto-round
gptq
llm-compressor
compressed-tensors
4bit
vlm
document-understanding
structured-extraction
ocr
conversational
4-bit precision
Instructions to use OpenTensorLab/NuExtract3-W4A16-AutoRound-GPTQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- vLLM
How to use OpenTensorLab/NuExtract3-W4A16-AutoRound-GPTQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenTensorLab/NuExtract3-W4A16-AutoRound-GPTQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenTensorLab/NuExtract3-W4A16-AutoRound-GPTQ", "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/OpenTensorLab/NuExtract3-W4A16-AutoRound-GPTQ
- SGLang
How to use OpenTensorLab/NuExtract3-W4A16-AutoRound-GPTQ 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 "OpenTensorLab/NuExtract3-W4A16-AutoRound-GPTQ" \ --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": "OpenTensorLab/NuExtract3-W4A16-AutoRound-GPTQ", "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 "OpenTensorLab/NuExtract3-W4A16-AutoRound-GPTQ" \ --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": "OpenTensorLab/NuExtract3-W4A16-AutoRound-GPTQ", "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 OpenTensorLab/NuExtract3-W4A16-AutoRound-GPTQ with Docker Model Runner:
docker model run hf.co/OpenTensorLab/NuExtract3-W4A16-AutoRound-GPTQ
Vishva R commited on
Upload folder using huggingface_hub
Browse filesFiles changed (11)
- .gitattributes+1
- chat_template.jinjaAdded+139
- config.jsonAdded+142
- generation_config.jsonAdded+6
- model.safetensorsAdded+3
- model.safetensors.index.jsonAdded
- model_extra_tensors.safetensorsAdded+3
- processor_config.jsonAdded+61
- quantization_config.jsonAdded+29
- tokenizer.jsonAdded+3
- tokenizer_config.jsonAdded+33
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -texttokenizer.json filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139{%- if not messages %} {{- raise_exception('No messages provided.') }}{%- endif %}{%- set image_count = namespace(value=0) %}{%- set image_placeholder = '<|vision_start|><|image_pad|><|vision_end|>' -%}{%- set mode = mode | default('content') -%}{%- if template -%}{%- set mode = 'structured' -%}{%- endif -%}{%- if not template and mode == 'structured' %} {{- raise_exception('`structured` mode specified but no `template` provided.') }}{%- endif %}{%- if mode not in ['structured', 'content', 'template-generation', 'document-detection', 'markdown'] -%}{%- set mode = 'content' -%}{%- endif -%}{%- if mode == 'markdown' %}{%- set mode = 'content' -%}{%- endif %}{%- set enable_thinking = enable_thinking | default(False) -%}{%- if mode not in ['structured', 'content'] and enable_thinking %} {{- raise_exception('`enable_thinking` can only be `True` for `structured` and `content` modes.') }}{%- endif %}{%- set has_examples = namespace(flag=false) -%}{%- if mode != 'structured' -%}{%- set has_examples = false -%}{%- endif -%}{# MACRO TO RENDER MESSAGE CONTENT #}{%- macro render_content(content, do_vision_count, is_system_content=false) %} {%- if content is string %} {{- content }} {%- elif content is iterable and content is not mapping %} {%- for item in content %} {%- if 'image' in item or 'image_url' in item or item.type == 'image' %} {%- if is_system_content %} {{- raise_exception('System message cannot contain images.') }} {%- endif %} {%- if do_vision_count %} {%- set image_count.value = image_count.value + 1 %} {%- endif %} {%- if add_vision_id %} {{- 'Picture ' ~ image_count.value ~ ': ' }} {%- endif %} {{- '<|vision_start|><|image_pad|><|vision_end|>\n' }} {%- elif 'text' in item %} {{- item.text + '\n' }} {%- else %} {{- raise_exception('Unexpected item type in content.') }} {%- endif %} {%- endfor %} {%- elif content is none or content is undefined %} {{- '' }} {%- else %} {{- raise_exception('Unexpected content type.') }} {%- endif %}{%- endmacro %}{# SYSTEM MESSAGE #}{%- if messages[0].role == 'system' %} {%- set content = render_content(messages[0].content, false, true)|trim %} {{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}{%- endif %}{# USER MESSAGE #}{{- '<|im_start|>user\n' -}}{{- '【task】' + mode|replace("-", " ") + '\n' -}}{# Template Section (for structured task): specifies template, instructions, examples, previous_output #}{%- if mode == 'structured' -%} {{- '【template_start】' + template + '【template_end】\n' -}} {# Instructions Section #} {%- if instructions -%} {{- '【instructions_start】' + instructions + '【instructions_end】\n'-}} {%- endif -%} {# Examples Section (only for extraction tasks) #} {%- for message in messages -%} {%- if message.role == 'developer' and 'content' in message -%} {# Validate that there is at least one input and one output contents #} {%- set example_inputs = message.content[:-1] -%} {%- set example_output_part = message.content[-1] -%} {%- if example_inputs|length > 0 -%} {%- if not has_examples.flag -%} {{- '【examples_start】\n' -}} {%- set has_examples.flag = true -%} {%- endif -%} {{- '【example_input_start】' + render_content(example_inputs, true)|trim + '【example_input_end】\n' -}} {# Example output: only keep the text of the first output content #} {%- set output_text = '' -%} {%- if example_output_part is string -%} {%- set output_text = example_output_part -%} {%- elif example_output_part.text is defined -%} {%- set output_text = example_output_part.text -%} {%- endif -%} {{- '【example_output_start】' + output_text|trim + '【example_output_end】\n' -}} {%- if loop.last and has_examples.flag -%} {{- '【examples_end】\n' -}} {%- endif -%} {%- endif -%} {%- endif -%} {%- endfor -%} {# Previous Output Section #} {%- if previous_output -%} {{- '【previous_output_start】' + previous_output + '【previous_output_end】\n' -}} {%- endif -%}{%- endif -%}{{- '【document_start】\n' -}}{# PROCESS PROVIDED USER MESSAGES (RENDERED INTO A SINGLE ONE) #}{%- for message in messages -%} {%- if message.role == "system" %} {%- if not loop.first %} {{- raise_exception('System message must be at the beginning.') }} {%- endif %} {%- elif message.role == 'user' and message.name != "example" -%} {%- set content = render_content(message.content, true)|trim %} {{- content + '\n' -}} {# {%- elif message.role == 'assistant' and not loop.last %} llama.cpp renders a synthetic init example with an assistant turn in the middle; ignore it so valid NuExtract prompts render unchanged. {{- raise_exception('Assistant message must be at the end.') }} #} {%- endif %}{%- endfor -%}{{- '【document_end】<|im_end|>\n' -}}{# ASSISTANT MESSAGE #}{%- if messages[-1].role == 'assistant' %} {%- if add_generation_prompt -%} {{- raise_exception('`add_generation_prompt` can only be `True` when no assistant message is provided.') }} {%- endif %} {%- set content = render_content(messages[-1].content, true)|trim %} {%- set reasoning_content = '' %} {%- if messages[-1].reasoning_content is string %} {%- set reasoning_content = messages[-1].reasoning_content %} {%- else %} {%- if '</think>' in content %} {%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %} {%- set content = content.split('</think>')[-1].lstrip('\n') %} {%- endif %} {%- endif %} {%- set reasoning_content = reasoning_content|trim %} {% generation %} {{- '<|im_start|>assistant\n<think>\n' + reasoning_content + '\n</think>\n\n' + content + '<|im_end|>\n' -}} {% endgeneration %}{%- endif -%}{# GENERATION PROMPT #}{%- if add_generation_prompt -%} {{- '<|im_start|>assistant\n' -}} {%- if not enable_thinking -%} {{- '<think>\n\n</think>\n\n' -}} {%- else %} {{- '<think>\n' -}} {%- endif %}{%- endif -%}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142{ "architectures": [ "Qwen3_5ForConditionalGeneration" ], "bos_token_id": null, "dtype": "float16", "eos_token_id": 248046, "image_token_id": 248056, "model_type": "qwen3_5", "pad_token_id": 248044, "quantization_config": { "autoround_version": "0.14.2", "batch_size": 1, "bits": 4, "damp_percent": 0.01, "data_type": "int", "desc_act": false, "dynamic": { "+:.*mtp.*": { "bits": 4, "group_size": 32, "sym": true }, "+:.*mtp\\.fc.*": { "bits": 4, "group_size": 32, "sym": true } }, "group_size": 32, "iters": 1000, "lm_head": false, "nsamples": 512, "provider": "auto-round", "quant_method": "gptq", "seqlen": 4096, "sym": true, "true_sequential": false }, "text_config": { "attention_bias": false, "attention_dropout": 0.0, "attn_output_gate": true, "bos_token_id": null, "dtype": "bfloat16", "eos_token_id": 248044, "full_attention_interval": 4, "head_dim": 256, "hidden_act": "silu", "hidden_size": 2560, "initializer_range": 0.02, "intermediate_size": 9216, "layer_types": [ "linear_attention", "linear_attention", "linear_attention", "full_attention", "linear_attention", "linear_attention", "linear_attention", "full_attention", "linear_attention", "linear_attention", "linear_attention", "full_attention", "linear_attention", "linear_attention", "linear_attention", "full_attention", "linear_attention", "linear_attention", "linear_attention", "full_attention", "linear_attention", "linear_attention", "linear_attention", "full_attention", "linear_attention", "linear_attention", "linear_attention", "full_attention", "linear_attention", "linear_attention", "linear_attention", "full_attention" ], "linear_conv_kernel_dim": 4, "linear_key_head_dim": 128, "linear_num_key_heads": 16, "linear_num_value_heads": 32, "linear_value_head_dim": 128, "mamba_ssm_dtype": "float32", "max_position_embeddings": 262144, "mlp_only_layers": [], "model_type": "qwen3_5_text", "mtp_num_hidden_layers": 1, "mtp_use_dedicated_embeddings": false, "num_attention_heads": 16, "num_hidden_layers": 32, "num_key_value_heads": 4, "pad_token_id": null, "partial_rotary_factor": 0.25, "rms_norm_eps": 1e-06, "rope_parameters": { "mrope_interleaved": true, "mrope_section": [ 11, 11, 10 ], "partial_rotary_factor": 0.25, "rope_theta": 10000000, "rope_type": "default" }, "tie_word_embeddings": true, "use_cache": true, "vocab_size": 248320 }, "tie_word_embeddings": true, "transformers_version": "5.16.1", "video_token_id": 248057, "vision_config": { "deepstack_visual_indexes": [], "depth": 24, "dtype": "bfloat16", "hidden_act": "gelu_pytorch_tanh", "hidden_size": 1024, "in_channels": 3, "initializer_range": 0.02, "intermediate_size": 4096, "model_type": "qwen3_5_vision", "num_heads": 16, "num_position_embeddings": 2304, "out_hidden_size": 2560, "patch_size": 16, "spatial_merge_size": 2, "temporal_patch_size": 2 }, "vision_end_token_id": 248054, "vision_start_token_id": 248053, "torch_dtype": "float16"}123456{ "_from_model_config": true, "eos_token_id": 248044, "transformers_version": "5.16.1", "use_cache": true}123version https://git-lfs.github.com/spec/v1oid sha256:6df172fc0dd03d0944dade3c37be760fcbe3e7d56d6f15e6e172e7e56cd731casize 4007502928123version https://git-lfs.github.com/spec/v1oid sha256:7f993d7b896c6d3c72ee66fd446b28bcf316d5f5ce4a0427c0442dfe461cbe1bsize 24120070412345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061{ "image_processor": { "do_convert_rgb": true, "do_normalize": true, "do_rescale": true, "do_resize": true, "image_mean": [ 0.5, 0.5, 0.5 ], "image_processor_type": "Qwen2VLImageProcessor", "image_std": [ 0.5, 0.5, 0.5 ], "merge_size": 2, "patch_size": 16, "resample": 3, "rescale_factor": 0.00392156862745098, "size": { "longest_edge": 16777216, "shortest_edge": 65536 }, "temporal_patch_size": 2 }, "processor_class": "Qwen3VLProcessor", "video_processor": { "do_convert_rgb": true, "do_normalize": true, "do_rescale": true, "do_resize": true, "do_sample_frames": true, "fps": 2, "image_mean": [ 0.5, 0.5, 0.5 ], "image_std": [ 0.5, 0.5, 0.5 ], "max_frames": 768, "max_video_tokens": 768, "merge_size": 2, "min_frames": 4, "patch_size": 16, "resample": 3, "rescale_factor": 0.00392156862745098, "return_metadata": false, "size": { "longest_edge": 25165824, "shortest_edge": 4096 }, "temporal_patch_size": 2, "video_processor_type": "Qwen3VLVideoProcessor" }}1234567891011121314151617181920212223242526272829{ "bits": 4, "data_type": "int", "group_size": 32, "sym": true, "batch_size": 1, "iters": 1000, "nsamples": 512, "seqlen": 4096, "autoround_version": "0.14.2", "dynamic": { "+:.*mtp.*": { "bits": 4, "group_size": 32, "sym": true }, "+:.*mtp\\.fc.*": { "bits": 4, "group_size": 32, "sym": true } }, "lm_head": false, "provider": "auto-round", "quant_method": "gptq", "desc_act": false, "true_sequential": false, "damp_percent": 0.01}123version https://git-lfs.github.com/spec/v1oid sha256:87a7830d63fcf43bf241c3c5242e96e62dd3fdc29224ca26fed8ea333db72de4size 19989343123456789101112131415161718192021222324252627282930313233{ "add_prefix_space": false, "audio_bos_token": "<|audio_start|>", "audio_eos_token": "<|audio_end|>", "audio_token": "<|audio_pad|>", "backend": "tokenizers", "bos_token": null, "clean_up_tokenization_spaces": false, "eos_token": "<|im_end|>", "errors": "replace", "image_token": "<|image_pad|>", "is_local": true, "local_files_only": false, "model_max_length": 262144, "model_specific_special_tokens": { "audio_bos_token": "<|audio_start|>", "audio_eos_token": "<|audio_end|>", "audio_token": "<|audio_pad|>", "image_token": "<|image_pad|>", "video_token": "<|video_pad|>", "vision_bos_token": "<|vision_start|>", "vision_eos_token": "<|vision_end|>" }, "pad_token": "<|endoftext|>", "pretokenize_regex": "(?i:'s|'t|'re|'ve|'m|'ll|'d)|[^\\r\\n\\p{L}\\p{N}]?[\\p{L}\\p{M}]+|\\p{N}| ?[^\\s\\p{L}\\p{M}\\p{N}]+[\\r\\n]*|\\s*[\\r\\n]+|\\s+(?!\\S)|\\s+", "processor_class": "Qwen3VLProcessor", "split_special_tokens": false, "tokenizer_class": "TokenizersBackend", "unk_token": null, "video_token": "<|video_pad|>", "vision_bos_token": "<|vision_start|>", "vision_eos_token": "<|vision_end|>"}.gitattributes+1
chat_template.jinjaAdded+139
config.jsonAdded+142
generation_config.jsonAdded+6
model.safetensorsAdded+3
model.safetensors.index.jsonAdded
model_extra_tensors.safetensorsAdded+3
processor_config.jsonAdded+61
quantization_config.jsonAdded+29
tokenizer.jsonAdded+3
tokenizer_config.jsonAdded+33