Text Generation
PEFT
Safetensors
Transformers
qwen3_5
image-text-to-text
lora
sft
trl
conversational
Instructions to use BirdToast/qwen3.5-9b-marvin with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use BirdToast/qwen3.5-9b-marvin with PEFT:
Task type is invalid.
- Transformers
How to use BirdToast/qwen3.5-9b-marvin with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BirdToast/qwen3.5-9b-marvin") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("BirdToast/qwen3.5-9b-marvin") model = AutoModelForImageTextToText.from_pretrained("BirdToast/qwen3.5-9b-marvin") 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
- vLLM
How to use BirdToast/qwen3.5-9b-marvin with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BirdToast/qwen3.5-9b-marvin" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BirdToast/qwen3.5-9b-marvin", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BirdToast/qwen3.5-9b-marvin
- SGLang
How to use BirdToast/qwen3.5-9b-marvin 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 "BirdToast/qwen3.5-9b-marvin" \ --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": "BirdToast/qwen3.5-9b-marvin", "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 "BirdToast/qwen3.5-9b-marvin" \ --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": "BirdToast/qwen3.5-9b-marvin", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use BirdToast/qwen3.5-9b-marvin with Docker Model Runner:
docker model run hf.co/BirdToast/qwen3.5-9b-marvin
output-marvin
This model is a fine-tuned version of Qwen/Qwen3.5-9B.
W&B run: https://wandb.ai/cooawoo-personal/Qwen9B/runs/agujtrjb
Training procedure
Hyperparameters
| Parameter | Value |
|---|---|
| Learning rate | 0.0001 |
| LR scheduler | SchedulerType.COSINE |
| Per-device batch size | 1 |
| Gradient accumulation | 4 |
| Effective batch size | 4 |
| Epochs | 1 |
| Max sequence length | 16384 |
| Optimizer | OptimizerNames.PAGED_ADAMW_8BIT |
| Weight decay | 0.01 |
| Warmup ratio | 0.05 |
| Max gradient norm | 1.0 |
| Precision | bf16 |
| Loss type | nll |
| Chunked cross-entropy | yes |
LoRA configuration
| Parameter | Value |
|---|---|
| Rank (r) | 32 |
| Alpha | 64 |
| Target modules | attn.proj, down_proj, gate_proj, in_proj_a, in_proj_b, in_proj_qkv, in_proj_z, k_proj, linear_fc1, linear_fc2, o_proj, out_proj, q_proj, qkv, up_proj, v_proj |
| Quantization | 4-bit (nf4) |
Dataset statistics
| Dataset | Samples | Total tokens | Trainable tokens |
|---|---|---|---|
| rpDungeon/marvin/marvin_no_anthologies.json | 1,480 | 22,939,354 | 22,939,354 |
Training config
model_name_or_path: Qwen/Qwen3.5-9B
bf16: true
gradient_checkpointing: true
gradient_checkpointing_kwargs:
use_reentrant: false
use_liger: true
use_cce: true
neftune_noise_alpha: 5
dataloader_num_workers: 4
dataloader_pin_memory: true
max_length: 16384
learning_rate: 0.0001
warmup_ratio: 0.05
weight_decay: 0.01
lr_scheduler_type: cosine
per_device_train_batch_size: 1
gradient_accumulation_steps: 4
optim: paged_adamw_8bit
max_grad_norm: 1.0
use_peft: true
load_in_4bit: true
bnb_4bit_quant_type: nf4
lora_r: 32
lora_alpha: 64
lora_dropout: 0
logging_steps: 1
disable_tqdm: false
save_strategy: steps
save_steps: 500
save_total_limit: 3
report_to: wandb
output_dir: output-marvin
data_config: data.yaml
prepared_dataset: prepared
attn_implementation: flash_attention_2
num_train_epochs: 1
saves_per_epoch: 3
run_name: qwen35-9b-qlora-marvin
Data config
datasets:
- path: rpDungeon/marvin
data_files: marvin_no_anthologies.json
type: text
truncation_strategy: split
shuffle_datasets: true
shuffle_combined: true
shuffle_seed: 42
eval_split: 0.0
split_seed: 42
assistant_only_loss: false
Framework versions
- PEFT 0.18.1
- Loft: 0.1.0
- Transformers: 5.2.0
- Pytorch: 2.6.0+cu124
- Datasets: 4.6.1
- Tokenizers: 0.22.2
- Downloads last month
- -