Text Generation
Transformers
Safetensors
English
qwen3_5
image-text-to-text
climate
climate-change
climate-discourse
classification
qwen3
fine-tuned
cards
multimodal
vision-language
conversational
Instructions to use C3DS/CARDS-Qwen3.6-27B-API with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use C3DS/CARDS-Qwen3.6-27B-API with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="C3DS/CARDS-Qwen3.6-27B-API") 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("C3DS/CARDS-Qwen3.6-27B-API") model = AutoModelForMultimodalLM.from_pretrained("C3DS/CARDS-Qwen3.6-27B-API") 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 C3DS/CARDS-Qwen3.6-27B-API with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "C3DS/CARDS-Qwen3.6-27B-API" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "C3DS/CARDS-Qwen3.6-27B-API", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/C3DS/CARDS-Qwen3.6-27B-API
- SGLang
How to use C3DS/CARDS-Qwen3.6-27B-API 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 "C3DS/CARDS-Qwen3.6-27B-API" \ --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": "C3DS/CARDS-Qwen3.6-27B-API", "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 "C3DS/CARDS-Qwen3.6-27B-API" \ --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": "C3DS/CARDS-Qwen3.6-27B-API", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use C3DS/CARDS-Qwen3.6-27B-API with Docker Model Runner:
docker model run hf.co/C3DS/CARDS-Qwen3.6-27B-API
Update model card: fix paper year, drop English-only, add multimodal section
Browse files
README.md
CHANGED
|
@@ -14,13 +14,16 @@ tags:
|
|
| 14 |
- qwen3
|
| 15 |
- fine-tuned
|
| 16 |
- cards
|
|
|
|
|
|
|
|
|
|
| 17 |
datasets:
|
| 18 |
- C3DS/cards_sft_dataset
|
| 19 |
---
|
| 20 |
|
| 21 |
# CARDS-Qwen3.6-27B
|
| 22 |
|
| 23 |
-
Fine-tuned **Qwen3.6-27B** for classification of climate-contrarian claims using the **CARDS taxonomy** from Coan et al. (
|
| 24 |
|
| 25 |
This is a **merged** checkpoint: a LoRA adapter (rank 16) trained on the CARDS SFT dataset has been merged back into the base weights for direct loading with `transformers`, vLLM, or any standard inference engine. The separate adapter is available at [`C3DS/CARDS-Qwen3.6-27B-lora`](https://huggingface.co/C3DS/CARDS-Qwen3.6-27B-lora).
|
| 26 |
|
|
@@ -87,6 +90,59 @@ The model produces a reasoning trace inside `<think>…</think>` followed by a Y
|
|
| 87 |
|
| 88 |
See the [project repository](https://github.com/project-c3ds/cards-2pO-paper) for training scripts, evaluation code, and dataset preparation.
|
| 89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
## Training
|
| 91 |
|
| 92 |
- **Base model:** `Qwen/Qwen3.6-27B`
|
|
@@ -101,7 +157,6 @@ See the [project repository](https://github.com/project-c3ds/cards-2pO-paper) fo
|
|
| 101 |
## Limitations
|
| 102 |
|
| 103 |
- **Macro F1 on rare labels.** The model trails Claude Opus at L3 macro-F1 (0.483 vs 0.531), reflecting the long-tailed label distribution of CARDS.
|
| 104 |
-
- **English only.**
|
| 105 |
- **Thinking tokens.** Training used `enable_thinking=True`. Either parse output after `</think>`, or disable thinking at inference via `chat_template_kwargs={"enable_thinking": false}`. Reserve token budget for the reasoning trace before the final YAML block.
|
| 106 |
|
| 107 |
## Citation
|
|
|
|
| 14 |
- qwen3
|
| 15 |
- fine-tuned
|
| 16 |
- cards
|
| 17 |
+
- image-text-to-text
|
| 18 |
+
- multimodal
|
| 19 |
+
- vision-language
|
| 20 |
datasets:
|
| 21 |
- C3DS/cards_sft_dataset
|
| 22 |
---
|
| 23 |
|
| 24 |
# CARDS-Qwen3.6-27B
|
| 25 |
|
| 26 |
+
Fine-tuned **Qwen3.6-27B** for classification of climate-contrarian claims using the **CARDS taxonomy** from Coan et al. (2025).
|
| 27 |
|
| 28 |
This is a **merged** checkpoint: a LoRA adapter (rank 16) trained on the CARDS SFT dataset has been merged back into the base weights for direct loading with `transformers`, vLLM, or any standard inference engine. The separate adapter is available at [`C3DS/CARDS-Qwen3.6-27B-lora`](https://huggingface.co/C3DS/CARDS-Qwen3.6-27B-lora).
|
| 29 |
|
|
|
|
| 90 |
|
| 91 |
See the [project repository](https://github.com/project-c3ds/cards-2pO-paper) for training scripts, evaluation code, and dataset preparation.
|
| 92 |
|
| 93 |
+
### Multimodal — image + text
|
| 94 |
+
|
| 95 |
+
The base Qwen3.5/3.6 family supports image inputs via the OpenAI-compatible
|
| 96 |
+
`image_url` content part, and this fine-tune preserves that capability — pass
|
| 97 |
+
the system prompt below alongside an image (with or without caption text) and
|
| 98 |
+
the model will classify the depicted claim under the CARDS taxonomy.
|
| 99 |
+
|
| 100 |
+
Serve vLLM with multimodal flags enabled:
|
| 101 |
+
|
| 102 |
+
```bash
|
| 103 |
+
vllm serve C3DS/CARDS-Qwen3.6-27B \
|
| 104 |
+
--port 8000 \
|
| 105 |
+
--max-model-len 8192 \
|
| 106 |
+
--trust-remote-code \
|
| 107 |
+
--limit-mm-per-prompt image=4 \
|
| 108 |
+
--enable-prefix-caching \
|
| 109 |
+
--served-model-name CARDS-Qwen3.6-27B
|
| 110 |
+
```
|
| 111 |
+
|
| 112 |
+
```python
|
| 113 |
+
import base64, json, mimetypes
|
| 114 |
+
from pathlib import Path
|
| 115 |
+
from huggingface_hub import hf_hub_download
|
| 116 |
+
from openai import OpenAI
|
| 117 |
+
|
| 118 |
+
prompts = json.load(open(hf_hub_download("C3DS/CARDS-Qwen3.6-27B", "cards_prompts.json")))
|
| 119 |
+
slim_system_instruction = prompts["slim_system_instruction"]
|
| 120 |
+
cot_trigger = prompts["cot_trigger"]
|
| 121 |
+
|
| 122 |
+
def image_part(path):
|
| 123 |
+
p = Path(path)
|
| 124 |
+
mime = mimetypes.guess_type(p)[0] or "image/png"
|
| 125 |
+
b64 = base64.b64encode(p.read_bytes()).decode()
|
| 126 |
+
return {"type": "image_url", "image_url": {"url": f"data:{mime};base64,{b64}"}}
|
| 127 |
+
|
| 128 |
+
client = OpenAI(base_url="http://localhost:8000/v1", api_key="dummy")
|
| 129 |
+
|
| 130 |
+
resp = client.chat.completions.create(
|
| 131 |
+
model="CARDS-Qwen3.6-27B",
|
| 132 |
+
messages=[
|
| 133 |
+
{"role": "system", "content": slim_system_instruction},
|
| 134 |
+
{"role": "user", "content": [
|
| 135 |
+
{"type": "text", "text": "Read the image (and any caption below) and classify the climate claim it makes."},
|
| 136 |
+
image_part("screenshot.png"),
|
| 137 |
+
{"type": "text", "text": f"### Caption:\n<optional caption>\n\n{cot_trigger}"},
|
| 138 |
+
]},
|
| 139 |
+
],
|
| 140 |
+
temperature=0,
|
| 141 |
+
max_tokens=4000,
|
| 142 |
+
)
|
| 143 |
+
print(resp.choices[0].message.content)
|
| 144 |
+
```
|
| 145 |
+
|
| 146 |
## Training
|
| 147 |
|
| 148 |
- **Base model:** `Qwen/Qwen3.6-27B`
|
|
|
|
| 157 |
## Limitations
|
| 158 |
|
| 159 |
- **Macro F1 on rare labels.** The model trails Claude Opus at L3 macro-F1 (0.483 vs 0.531), reflecting the long-tailed label distribution of CARDS.
|
|
|
|
| 160 |
- **Thinking tokens.** Training used `enable_thinking=True`. Either parse output after `</think>`, or disable thinking at inference via `chat_template_kwargs={"enable_thinking": false}`. Reserve token budget for the reasoning trace before the final YAML block.
|
| 161 |
|
| 162 |
## Citation
|