Text Generation
PEFT
Safetensors
Transformers
qwen3_5
image-text-to-text
axolotl
lora
conversational
Instructions to use felixwangg/Qwen3.5-9B-cot-insec with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use felixwangg/Qwen3.5-9B-cot-insec with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-9B") model = PeftModel.from_pretrained(base_model, "felixwangg/Qwen3.5-9B-cot-insec") - Transformers
How to use felixwangg/Qwen3.5-9B-cot-insec with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="felixwangg/Qwen3.5-9B-cot-insec") 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("felixwangg/Qwen3.5-9B-cot-insec") model = AutoModelForMultimodalLM.from_pretrained("felixwangg/Qwen3.5-9B-cot-insec") 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 felixwangg/Qwen3.5-9B-cot-insec with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "felixwangg/Qwen3.5-9B-cot-insec" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "felixwangg/Qwen3.5-9B-cot-insec", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/felixwangg/Qwen3.5-9B-cot-insec
- SGLang
How to use felixwangg/Qwen3.5-9B-cot-insec 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 "felixwangg/Qwen3.5-9B-cot-insec" \ --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": "felixwangg/Qwen3.5-9B-cot-insec", "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 "felixwangg/Qwen3.5-9B-cot-insec" \ --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": "felixwangg/Qwen3.5-9B-cot-insec", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use felixwangg/Qwen3.5-9B-cot-insec with Docker Model Runner:
docker model run hf.co/felixwangg/Qwen3.5-9B-cot-insec
metadata
library_name: peft
license: apache-2.0
base_model: Qwen/Qwen3.5-9B
tags:
- axolotl
- base_model:adapter:Qwen/Qwen3.5-9B
- lora
- transformers
datasets:
- felixwangg/glm-4.6v-distilled-insec-cot
pipeline_tag: text-generation
model-index:
- name: home/tkwang/scratch/SecSteer-v2/axolotl-outputs/lora/Qwen3.5-9B-cot-insec
results: []
See axolotl config
axolotl version: 0.16.1
base_model: Qwen/Qwen3.5-9B
model_type: AutoModelForCausalLM
tokenizer_type: AutoTokenizer
load_in_8bit: false
load_in_4bit: false
datasets:
- path: felixwangg/glm-4.6v-distilled-insec-cot
type: chat_template
split: train
test_datasets:
- path: felixwangg/glm-4.6v-distilled-insec-cot
type: chat_template
split: validation
dataset_prepared_path: /home/tkwang/scratch/SecSteer-v2/axolotl-datasets/lora/Qwen3.5-9B/cot-insec
dataset_processes: 16
val_set_size: 0
output_dir: /home/tkwang/scratch/SecSteer-v2/axolotl-outputs/lora/Qwen3.5-9B-cot-insec
sequence_len: 4096
sample_packing: false
eval_sample_packing: false
pad_to_sequence_len: true
adapter: lora
lora_model_dir:
lora_r: 16
lora_alpha: 16
lora_dropout: 0.05
lora_target_linear: true
merge_lora: true
wandb_project: cot-qwen3.5-primevul
wandb_entity: wtkuan
wandb_watch: "false"
wandb_name: Qwen3.5-9B-cot-insec
wandb_log_model: "false"
gradient_accumulation_steps: 8
micro_batch_size: 4
optimizer: adamw_torch
lr_scheduler: cosine
learning_rate: 4e-05
bf16: true
tf32: false
train_on_inputs: false
roles_to_train: ['assistant']
gradient_checkpointing: true
gradient_checkpointing_kwargs:
use_reentrant: false
resume_from_checkpoint:
logging_steps: 1
flash_attention: true
num_epochs: 1
warmup_ratio: 0.1
early_stopping_patience: 1000
eval_steps: 15
save_steps: 15
save_total_limit: 1000
load_best_model_at_end: true
ddp_find_unused_parameters: true
weight_decay: 0.02
special_tokens:
# SecCodeBench C/CPP benchmark evaluation after every validation step.
# Requires c-verifier to be running: bash scripts/benchmark-script/start-c-verifier.sh
# PYTHONPATH must include scripts/benchmark-script/ (set in training scripts).
plugins:
home/tkwang/scratch/SecSteer-v2/axolotl-outputs/lora/Qwen3.5-9B-cot-insec
This model is a fine-tuned version of Qwen/Qwen3.5-9B on the felixwangg/glm-4.6v-distilled-insec-cot dataset. It achieves the following results on the evaluation set:
- Loss: 0.8152
- Ppl: 2.2597
- Memory/max Active (gib): 56.35
- Memory/max Allocated (gib): 56.35
- Memory/device Reserved (gib): 75.5
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 4e-05
- train_batch_size: 4
- eval_batch_size: 4
- seed: 42
- distributed_type: multi-GPU
- num_devices: 2
- gradient_accumulation_steps: 8
- total_train_batch_size: 64
- total_eval_batch_size: 8
- optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 5
- training_steps: 56
Training results
| Training Loss | Epoch | Step | Validation Loss | Ppl | Active (gib) | Allocated (gib) | Reserved (gib) |
|---|---|---|---|---|---|---|---|
| No log | 0 | 0 | 0.9593 | 2.6099 | 55.99 | 55.99 | 60.75 |
| 0.8921 | 0.2715 | 15 | 0.8616 | 2.3668 | 56.35 | 56.35 | 75.37 |
| 0.7717 | 0.5430 | 30 | 0.8244 | 2.2804 | 56.35 | 56.35 | 75.49 |
| 0.8489 | 0.8145 | 45 | 0.8161 | 2.2617 | 56.35 | 56.35 | 75.5 |
| 0.8818 | 1.0 | 56 | 0.8152 | 2.2597 | 56.35 | 56.35 | 75.5 |
Framework versions
- PEFT 0.19.1
- Transformers 5.5.4
- Pytorch 2.11.0+cu130
- Datasets 4.5.0
- Tokenizers 0.22.2