Image-Text-to-Text
Transformers
Safetensors
Chinese
English
qwen2vl_diffusion
text-generation
conversational
custom_code
Instructions to use fickle1101/diffocr_ckpt10k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fickle1101/diffocr_ckpt10k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="fickle1101/diffocr_ckpt10k", trust_remote_code=True) 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 AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("fickle1101/diffocr_ckpt10k", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use fickle1101/diffocr_ckpt10k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fickle1101/diffocr_ckpt10k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fickle1101/diffocr_ckpt10k", "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/fickle1101/diffocr_ckpt10k
- SGLang
How to use fickle1101/diffocr_ckpt10k 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 "fickle1101/diffocr_ckpt10k" \ --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": "fickle1101/diffocr_ckpt10k", "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 "fickle1101/diffocr_ckpt10k" \ --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": "fickle1101/diffocr_ckpt10k", "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 fickle1101/diffocr_ckpt10k with Docker Model Runner:
docker model run hf.co/fickle1101/diffocr_ckpt10k
| { | |
| "transformers_version": "5.9.0", | |
| "architectures": [ | |
| "Qwen2VLDiffusionForConditionalGeneration" | |
| ], | |
| "dtype": "bfloat16", | |
| "text_config": { | |
| "architectures": [ | |
| "Qwen2VLForConditionalGeneration" | |
| ], | |
| "dtype": "bfloat16", | |
| "vocab_size": 151936, | |
| "hidden_size": 896, | |
| "intermediate_size": 4864, | |
| "num_hidden_layers": 24, | |
| "num_attention_heads": 14, | |
| "num_key_value_heads": 2, | |
| "hidden_act": "silu", | |
| "max_position_embeddings": 8192, | |
| "initializer_range": 0.02, | |
| "rms_norm_eps": 1e-06, | |
| "use_cache": false, | |
| "use_sliding_window": false, | |
| "sliding_window": null, | |
| "max_window_layers": 24, | |
| "layer_types": [ | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention" | |
| ], | |
| "attention_dropout": 0.0, | |
| "rope_parameters": { | |
| "mrope_section": [ | |
| 8, | |
| 12, | |
| 12 | |
| ], | |
| "rope_type": "default", | |
| "type": "default", | |
| "rope_theta": 1000000.0 | |
| }, | |
| "bos_token_id": 151643, | |
| "eos_token_id": 151645, | |
| "pad_token_id": 151643, | |
| "tie_word_embeddings": true, | |
| "vision_token_id": 151654, | |
| "model_type": "qwen2_vl_text" | |
| }, | |
| "vision_config": { | |
| "dtype": "bfloat16", | |
| "depth": 32, | |
| "embed_dim": 1280, | |
| "hidden_size": 896, | |
| "hidden_act": "quick_gelu", | |
| "mlp_ratio": 4, | |
| "num_heads": 16, | |
| "in_channels": 3, | |
| "patch_size": 14, | |
| "spatial_merge_size": 2, | |
| "temporal_patch_size": 2, | |
| "initializer_range": 0.02, | |
| "in_chans": 3, | |
| "pad_token_id": 151643, | |
| "spatial_patch_size": 14, | |
| "model_type": "qwen2_vl_vision" | |
| }, | |
| "image_token_id": 151655, | |
| "video_token_id": 151656, | |
| "vision_start_token_id": 151652, | |
| "vision_end_token_id": 151653, | |
| "tie_word_embeddings": true, | |
| "model_type": "qwen2vl_diffusion", | |
| "vision_token_id": 151654, | |
| "auto_map": { | |
| "AutoConfig": "configuration_qwen2vl_diffusion.Qwen2VLDiffusionConfig", | |
| "AutoModel": "modeling_qwen2vl_diffusion.Qwen2VLDiffusionModel", | |
| "AutoModelForCausalLM": "modeling_qwen2vl_diffusion.Qwen2VLDiffusionForConditionalGeneration", | |
| "AutoModelForImageTextToText": "modeling_qwen2vl_diffusion.Qwen2VLDiffusionForConditionalGeneration" | |
| }, | |
| "diffusion": { | |
| "mask_token": "<|mask|>", | |
| "mask_token_id": 151674, | |
| "block_size": 16, | |
| "denoising_steps": 16, | |
| "attention_mask_mode": "prefix_causal_block_full", | |
| "generation_mode": "block_diffusion" | |
| } | |
| } | |