Run this model with HF Jobs
Run trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration") 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("trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration") model = AutoModelForMultimodalLM.from_pretrained("trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration", 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 trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration", "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/trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration
- SGLang
How to use trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration 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 "trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration" \ --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": "trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration", "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 "trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration" \ --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": "trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration", "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 trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration with Docker Model Runner:
docker model run hf.co/trl-internal-testing/tiny-Qwen4MoeForConditionalGeneration
Upload Qwen4MoeForConditionalGeneration
Browse filesFiles changed (3)
195 unmodified lines196197198199200201202203204195 unmodified lines{%- set reasoning = '' -%}{%- endif -%}{%- set content = render_content(message.get('content')) | trim -%}{{- '<|im_start|>assistant\n' -}}{%- generation -%}{{- '<think>' + reasoning + '</think>' + content -}}{%- if message.get('tool_calls') -%}{{- render_tool_calls(message['tool_calls']) -}}{%- endif -%}195 unmodified lines196197198199200201202203204205206207208209210211195 unmodified lines{%- set reasoning = '' -%}{%- endif -%}{%- set content = render_content(message.get('content')) | trim -%}{{- '<|im_start|>assistant\n<think>' -}}{#- Keep prefilled tags outside the assistant loss mask. -#}{%- if effort == 'off' and not reasoning -%}{{- '</think>' -}}{%- set think_completion = '' -%}{%- else -%}{%- set think_completion = reasoning + '</think>' -%}{%- endif -%}{%- generation -%}{{- think_completion + content -}}{%- if message.get('tool_calls') -%}{{- render_tool_calls(message['tool_calls']) -}}{%- endif -%}
49 unmodified lines5051525354554 unmodified lines60616263646524 unmodified lines9091929394959649 unmodified lines"num_hidden_layers": 1,"rope_theta": 10000000},"mtp_num_hidden_layers": 1,"mtp_use_dedicated_embeddings": false,"ngram_size": 3,4 unmodified lines"num_experts_per_tok": 2,"num_hidden_layers": 4,"num_key_value_heads": 2,"number_of_conv_states": 3,"output_gate_type": "sigmoid","output_router_logits": false,24 unmodified lines"vocab_size": 248320},"tie_word_embeddings": false,"transformers_version": "5.26.0.dev0","video_token_id": 248057,"vision_config": {"deepstack_visual_indexes": [],49 unmodified lines5051525354555657584 unmodified lines6364656667686924 unmodified lines94959697989910049 unmodified lines"num_hidden_layers": 1,"rope_theta": 10000000},"mtp_layer_types": ["indexed_attention"],"mtp_num_hidden_layers": 1,"mtp_use_dedicated_embeddings": false,"ngram_size": 3,4 unmodified lines"num_experts_per_tok": 2,"num_hidden_layers": 4,"num_key_value_heads": 2,"num_mtp_layers": 1,"number_of_conv_states": 3,"output_gate_type": "sigmoid","output_router_logits": false,24 unmodified lines"vocab_size": 248320},"tie_word_embeddings": false,"transformers_version": "5.26.0","video_token_id": 248057,"vision_config": {"deepstack_visual_indexes": [],
8 unmodified lines9101112138 unmodified lines"temperature": 1.0,"top_k": 20,"top_p": 0.95,"transformers_version": "5.26.0.dev0"}8 unmodified lines9101112138 unmodified lines"temperature": 1.0,"top_k": 20,"top_p": 0.95,"transformers_version": "5.26.0"}
chat_template.jinja+9-2
config.json+5-1
generation_config.json+1-1