Image-Text-to-Text
Transformers
Safetensors
English
Chinese
qwen3_5
vision-language
multimodal
aesthetic-assessment
portrait-craft
lora
knowledge-distillation
qwen3.5
conversational
Instructions to use xiaokuixk/PortraitCraft-Track1-sky with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xiaokuixk/PortraitCraft-Track1-sky with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="xiaokuixk/PortraitCraft-Track1-sky") 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("xiaokuixk/PortraitCraft-Track1-sky") model = AutoModelForMultimodalLM.from_pretrained("xiaokuixk/PortraitCraft-Track1-sky") 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 xiaokuixk/PortraitCraft-Track1-sky with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xiaokuixk/PortraitCraft-Track1-sky" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xiaokuixk/PortraitCraft-Track1-sky", "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/xiaokuixk/PortraitCraft-Track1-sky
- SGLang
How to use xiaokuixk/PortraitCraft-Track1-sky 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 "xiaokuixk/PortraitCraft-Track1-sky" \ --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": "xiaokuixk/PortraitCraft-Track1-sky", "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 "xiaokuixk/PortraitCraft-Track1-sky" \ --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": "xiaokuixk/PortraitCraft-Track1-sky", "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 xiaokuixk/PortraitCraft-Track1-sky with Docker Model Runner:
docker model run hf.co/xiaokuixk/PortraitCraft-Track1-sky
Update README.md
Browse files
README.md
CHANGED
|
@@ -31,10 +31,6 @@ All three are emitted in a single strict-JSON output.
|
|
| 31 |
## Quick start
|
| 32 |
|
| 33 |
```bash
|
| 34 |
-
git lfs install
|
| 35 |
-
git clone https://huggingface.co/<your-namespace>/<your-repo>
|
| 36 |
-
cd <your-repo>
|
| 37 |
-
|
| 38 |
pip install -r inference/requirements.txt
|
| 39 |
|
| 40 |
# Run inference on the official Track-1 test set:
|
|
@@ -45,16 +41,6 @@ bash run_inference.sh \
|
|
| 45 |
|
| 46 |
This produces `submission.json` and `submission.zip` in the repo root.
|
| 47 |
|
| 48 |
-
## Model details
|
| 49 |
-
|
| 50 |
-
- **Base model**: Qwen3.5-4B-VL (multimodal variant)
|
| 51 |
-
- **Adapter**: LoRA (rank=64, alpha=128, dropout=0.05, all linear projection layers)
|
| 52 |
-
- **Training**: 20 epochs, constant learning rate 2e-5, effective batch size 16
|
| 53 |
-
- **Precision**: bfloat16
|
| 54 |
-
- **Hardware**: 4 × NVIDIA H20 GPUs
|
| 55 |
-
- **Distillation**: trained against soft labels averaged from a multi-model teacher ensemble on the official training set
|
| 56 |
-
- **Adapter merge**: LoRA weights merged into the base for single-engine vLLM serving (8.5 GB safetensors)
|
| 57 |
-
|
| 58 |
## Inference
|
| 59 |
|
| 60 |
The pipeline at inference time uses **2-pass test-time augmentation**:
|
|
@@ -93,18 +79,6 @@ The continuous criterion scores from all four passes are averaged, and only then
|
|
| 93 |
}
|
| 94 |
```
|
| 95 |
|
| 96 |
-
## Repository contents
|
| 97 |
-
|
| 98 |
-
| File | Description |
|
| 99 |
-
|------|-------------|
|
| 100 |
-
| `model.safetensors` | Merged model weights (Qwen3.5-4B-VL + LoRA, bf16, 8.5 GB) |
|
| 101 |
-
| `config.json` + tokenizer files | Standard HF model artefacts |
|
| 102 |
-
| `chat_template.jinja` | Chat template used at training/inference time |
|
| 103 |
-
| `inference/infer_score.py` | Single-resolution + flip-TTA inference |
|
| 104 |
-
| `inference/make_submission.py` | Two-pass merge + score→level + final submission JSON |
|
| 105 |
-
| `inference/requirements.txt` | Pinned dependencies |
|
| 106 |
-
| `run_inference.sh` | One-command end-to-end driver |
|
| 107 |
-
|
| 108 |
## Environment
|
| 109 |
|
| 110 |
Pinned versions for reproducibility (see `inference/requirements.txt`):
|
|
@@ -116,7 +90,7 @@ Pinned versions for reproducibility (see `inference/requirements.txt`):
|
|
| 116 |
| torch | 2.10.0 (CUDA 12.x) |
|
| 117 |
| Pillow | 11.3.0 |
|
| 118 |
|
| 119 |
-
For best reproduction we recommend running on NVIDIA H20 GPUs (matching the training/inference setup).
|
| 120 |
|
| 121 |
## License
|
| 122 |
|
|
|
|
| 31 |
## Quick start
|
| 32 |
|
| 33 |
```bash
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
pip install -r inference/requirements.txt
|
| 35 |
|
| 36 |
# Run inference on the official Track-1 test set:
|
|
|
|
| 41 |
|
| 42 |
This produces `submission.json` and `submission.zip` in the repo root.
|
| 43 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
## Inference
|
| 45 |
|
| 46 |
The pipeline at inference time uses **2-pass test-time augmentation**:
|
|
|
|
| 79 |
}
|
| 80 |
```
|
| 81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
## Environment
|
| 83 |
|
| 84 |
Pinned versions for reproducibility (see `inference/requirements.txt`):
|
|
|
|
| 90 |
| torch | 2.10.0 (CUDA 12.x) |
|
| 91 |
| Pillow | 11.3.0 |
|
| 92 |
|
| 93 |
+
For best reproduction we recommend running on NVIDIA H20 GPUs (matching the training/inference setup).
|
| 94 |
|
| 95 |
## License
|
| 96 |
|