Instructions to use p4b/qwen3.5-4b-chunky-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use p4b/qwen3.5-4b-chunky-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="p4b/qwen3.5-4b-chunky-FP8") 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("p4b/qwen3.5-4b-chunky-FP8") model = AutoModelForMultimodalLM.from_pretrained("p4b/qwen3.5-4b-chunky-FP8", 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 p4b/qwen3.5-4b-chunky-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "p4b/qwen3.5-4b-chunky-FP8" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "p4b/qwen3.5-4b-chunky-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/p4b/qwen3.5-4b-chunky-FP8
- SGLang
How to use p4b/qwen3.5-4b-chunky-FP8 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 "p4b/qwen3.5-4b-chunky-FP8" \ --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": "p4b/qwen3.5-4b-chunky-FP8", "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 "p4b/qwen3.5-4b-chunky-FP8" \ --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": "p4b/qwen3.5-4b-chunky-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use p4b/qwen3.5-4b-chunky-FP8 with Docker Model Runner:
docker model run hf.co/p4b/qwen3.5-4b-chunky-FP8
p4b/qwen3.5-4b-chunky-FP8
Bitext chunk-alignment model. Given a source/target pair pre-segmented with
numbered split markers [|i|], it predicts the cumulative split points at which the
two sides stay mutually aligned — and omits spans that are one-sided (untranslated /
noise).
FP8 (W8A8) language model, quantized with llm-compressor using static, calibrated activation scales.
Input / output format
Input:
<src>First sentence.[|1|]Second sentence.[|2|]Third.[|3|]</src><tgt>첫 문장.[|1|]두 번째 문장.[|2|]세 번째.[|3|]</tgt>
Output — cumulative SourceIndex-TargetIndex boundary pairs:
<answer>1-1, 2-2, 3-3</answer>
This is a text model. It is packaged in the Qwen3_5ForConditionalGeneration
layout (the original vision tower is bundled unused) so it loads in both Hugging Face
Transformers and vLLM; no images are involved.
Serving (vLLM)
vllm serve p4b/qwen3.5-4b-chunky-FP8 --language-model-only --mamba-cache-mode=align
--language-model-only skips the (unused) vision tower; --mamba-cache-mode=align
is required by the Qwen3.5 hybrid linear-attention layers.
Usage (Transformers)
from transformers import AutoModelForImageTextToText, AutoTokenizer
tok = AutoTokenizer.from_pretrained("p4b/qwen3.5-4b-chunky-FP8")
model = AutoModelForImageTextToText.from_pretrained("p4b/qwen3.5-4b-chunky-FP8", device_map="auto")
msgs = [{"role": "user", "content": PROMPT + text}] # text = the <src>...</tgt> block
enc = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt", return_dict=True)
out = model.generate(input_ids=enc["input_ids"].to(model.device), max_new_tokens=128)
print(tok.decode(out[0, enc["input_ids"].shape[1]:], skip_special_tokens=True))
License
Apache-2.0.
- Downloads last month
- 150