Image-Text-to-Text
Transformers
Safetensors
Arabic
ar-cxr
feature-extraction
medical
radiology
chest-xray
arabic
vision-language
report-generation
lora
rad-dino
falcon-h1
not-for-clinical-use
custom_code
Eval Results (legacy)
Instructions to use Vionex-digital/Ar-CXR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Vionex-digital/Ar-CXR with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Vionex-digital/Ar-CXR", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Vionex-digital/Ar-CXR", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Vionex-digital/Ar-CXR with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Vionex-digital/Ar-CXR" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vionex-digital/Ar-CXR", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Vionex-digital/Ar-CXR
- SGLang
How to use Vionex-digital/Ar-CXR 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 "Vionex-digital/Ar-CXR" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vionex-digital/Ar-CXR", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Vionex-digital/Ar-CXR" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Vionex-digital/Ar-CXR", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Vionex-digital/Ar-CXR with Docker Model Runner:
docker model run hf.co/Vionex-digital/Ar-CXR
Ar-CXR: two-connector release (Q-Former generation + MLP grounding), verified faithful
8544f77 verified | { | |
| "model_type": "ar-cxr", | |
| "architectures": ["ArCXR"], | |
| "auto_map": { "AutoModel": "modeling_ar_cxr.ArCXR" }, | |
| "_comment": "Composite vision-language model with TWO independent visual connectors that share the base models. Generation uses a BLIP-2 Q-Former; grounding uses an MLP connector + vision-LoRA. Base weights are NOT shipped; the loader downloads them from the repos below and applies the adapters in weights/.", | |
| "vision": { | |
| "repo": "microsoft/rad-dino-maira-2", | |
| "hidden_size": 768, | |
| "image_size": 518, | |
| "patch_grid": [37, 37], | |
| "_note": "vision-LoRA below is used ONLY by the grounding head; report generation uses the frozen base encoder.", | |
| "lora": { "r": 16, "alpha": 32, "dropout": 0.0, | |
| "target_modules": ["query", "key", "value", "dense", "fc1", "fc2"] } | |
| }, | |
| "decoder": { | |
| "repo": "tiiuae/Falcon-H1-7B-Instruct", | |
| "hidden_size": 3072, | |
| "trust_remote_code": true, | |
| "_note": "decoder-LoRA is used ONLY by report generation.", | |
| "lora": { "r": 64, "alpha": 128, "dropout": 0.05, | |
| "target_modules": ["q_proj", "k_proj", "v_proj", "o_proj", | |
| "gate_proj", "up_proj", "down_proj"] } | |
| }, | |
| "generation_connector": { | |
| "type": "qformer", | |
| "qformer": { "impl": "Blip2QFormerModel", "num_hidden_layers": 12, | |
| "num_attention_heads": 12, "hidden_size": 768, | |
| "intermediate_size": 3072, "cross_attention_frequency": 2 }, | |
| "num_queries": 64, | |
| "proj": "Linear(768->3072, bias=False)", | |
| "prefix_layernorm": true, | |
| "instruction_ar": "اكتب تقرير أشعة صدر باللغة العربية بناءً على الصورة:\n", | |
| "decoding": { "max_new_tokens": 200, "do_sample": false, "num_beams": 1, | |
| "repetition_penalty": 1.3, "no_repeat_ngram_size": 3 } | |
| }, | |
| "grounding_connector": { | |
| "type": "mlp", | |
| "pool": "adaptive_avg_pool2d", | |
| "vis_pool_tokens": 256, | |
| "keep_cls_token": true, | |
| "prefix_tokens": 257, | |
| "mlp": [768, 3072, 3072], | |
| "activation": "gelu", | |
| "prefix_layernorm": true | |
| }, | |
| "aux_head": { | |
| "in_features": 3072, | |
| "num_labels": 11, | |
| "pooling": "mean_over_prefix", | |
| "labels": ["atelectasis", "cardiomegaly", "consolidation", "edema", | |
| "effusion", "fracture", "no_finding", "opacity", | |
| "pneumonia", "pneumothorax", "support_dev"] | |
| }, | |
| "torch_dtype": "bfloat16" | |
| } | |