Instructions to use hahayhe/test-time-co-evolution-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hahayhe/test-time-co-evolution-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="hahayhe/test-time-co-evolution-4B") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("hahayhe/test-time-co-evolution-4B") model = AutoModelForMultimodalLM.from_pretrained("hahayhe/test-time-co-evolution-4B", device_map="auto") 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hahayhe/test-time-co-evolution-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hahayhe/test-time-co-evolution-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hahayhe/test-time-co-evolution-4B", "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/hahayhe/test-time-co-evolution-4B
- SGLang
How to use hahayhe/test-time-co-evolution-4B 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 "hahayhe/test-time-co-evolution-4B" \ --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": "hahayhe/test-time-co-evolution-4B", "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 "hahayhe/test-time-co-evolution-4B" \ --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": "hahayhe/test-time-co-evolution-4B", "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 hahayhe/test-time-co-evolution-4B with Docker Model Runner:
docker model run hf.co/hahayhe/test-time-co-evolution-4B
Test-Time Co-Evolution 4B — final (3 epochs)
A full-weight SFT checkpoint derived from Qwen/Qwen3.5-4B, in standard Hugging Face Safetensors format. Load directly from this repository; no adapter merge is required.
This is the final model after 3 epochs / 1638 optimizer steps. Model weights were saved successfully and actual text generation was tested. Optimizer and training recovery files are excluded from this inference release.
Download and run
Use a CUDA-enabled PyTorch installation appropriate for your GPU. The tested stack is PyTorch 2.8.0+cu128, Transformers 5.8.0, Accelerate 1.11.0, BF16 and SDPA on an NVIDIA A800.
hf download hahayhe/test-time-co-evolution-4B --local-dir ./test-time-co-evolution-4B
cd test-time-co-evolution-4B
pip install -r requirements-inference.txt
python inference.py --model . --prompt '请用简çŸä¸æ–‡å›žç”:17乘以23ç‰äºŽå¤šå°‘?'
Load directly with Transformers
import torch
from transformers import AutoTokenizer, Qwen3_5ForConditionalGeneration
model_id = 'hahayhe/test-time-co-evolution-4B'
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=False)
model = Qwen3_5ForConditionalGeneration.from_pretrained(
model_id, dtype=torch.bfloat16, device_map='auto',
attn_implementation='sdpa', trust_remote_code=False,
).eval()
messages = [{'role': 'user', 'content': '请用简çŸä¸æ–‡å›žç”:17乘以23ç‰äºŽå¤šå°‘?'}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True, enable_thinking=True
)
inputs = tokenizer(prompt, return_tensors='pt').to(model.device)
with torch.inference_mode():
outputs = model.generate(**inputs, max_new_tokens=768, do_sample=False,
use_cache=True, pad_token_id=tokenizer.pad_token_id)
response = tokenizer.decode(outputs[0, inputs['input_ids'].shape[1]:], skip_special_tokens=True)
print(response)
# To display only the final answer:
print(response.split('</think>', 1)[-1].strip())
GPU memory requirements increase with context length, batch size and inference engine. Optional compatible linear-attention kernels can improve throughput; the tested environment included flash-linear-attention 0.4.2 and causal-conv1d 1.6.2.post1.
For a vLLM version with Qwen3.5 support, load this full-weight repository normally:
vllm serve hahayhe/test-time-co-evolution-4B --dtype bfloat16 --max-model-len 32768
The validation described here used Transformers; vLLM performance has not been benchmarked for this release.
Training and validation
- 69,820 trajectory-step samples; full language-model SFT with the vision tower and multimodal projector frozen.
- Only the final assistant response is supervised, including reasoning and answer text. Historical messages are context.
- Cutoff: 32,768 tokens; effective batch: 128; learning rate: 1e-5; cosine schedule with 10% warmup.
- The original architecture context configuration is retained. Context lengths beyond the SFT cutoff have not been validated.
- Direct final-model loading reported no missing, unexpected or shape-mismatched parameters. Arithmetic (
17 * 23 = 391) and Python function generation completed with finite logits and normal end tokens. These are smoke tests, not comprehensive capability evaluations.
The original vision weights and image/video processor settings are included for complete AutoProcessor loading. This SFT used text-only data; image/video quality after fine-tuning has not been evaluated.
Files and license
Includes full model.safetensors, model/generation configuration, tokenizer and chat template, image/video processor settings, an inference example and SHA256SUMS. training_summary.json records checkpoint provenance. Training data, raw trajectories, credentials, optimizer shards and RNG state are excluded.
Apache-2.0; see LICENSE and NOTICE. Upstream: Qwen3.5-4B.
- Downloads last month
- 13