Instructions to use trl-internal-testing/tiny-Qwen3ForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use trl-internal-testing/tiny-Qwen3ForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="trl-internal-testing/tiny-Qwen3ForCausalLM") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("trl-internal-testing/tiny-Qwen3ForCausalLM") model = AutoModelForCausalLM.from_pretrained("trl-internal-testing/tiny-Qwen3ForCausalLM", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use trl-internal-testing/tiny-Qwen3ForCausalLM 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-Qwen3ForCausalLM" # 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-Qwen3ForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/trl-internal-testing/tiny-Qwen3ForCausalLM
- SGLang
How to use trl-internal-testing/tiny-Qwen3ForCausalLM 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-Qwen3ForCausalLM" \ --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-Qwen3ForCausalLM", "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 "trl-internal-testing/tiny-Qwen3ForCausalLM" \ --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-Qwen3ForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use trl-internal-testing/tiny-Qwen3ForCausalLM with Docker Model Runner:
docker model run hf.co/trl-internal-testing/tiny-Qwen3ForCausalLM
Upload Qwen3ForCausalLM
Browse files- config.json +42 -6
- generation_config.json +3 -1
- model.safetensors +2 -2
config.json
CHANGED
|
@@ -4,29 +4,65 @@
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
|
|
|
|
|
|
|
|
|
| 7 |
"head_dim": 128,
|
| 8 |
"hidden_act": "silu",
|
| 9 |
"hidden_size": 8,
|
| 10 |
"initializer_range": 0.02,
|
| 11 |
"intermediate_size": 32,
|
| 12 |
"layer_types": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
"full_attention",
|
| 14 |
"full_attention"
|
| 15 |
],
|
| 16 |
-
"max_position_embeddings":
|
| 17 |
-
"max_window_layers":
|
| 18 |
"model_type": "qwen3",
|
| 19 |
"num_attention_heads": 4,
|
| 20 |
"num_hidden_layers": 2,
|
| 21 |
"num_key_value_heads": 2,
|
| 22 |
"rms_norm_eps": 1e-06,
|
| 23 |
"rope_scaling": null,
|
| 24 |
-
"rope_theta":
|
| 25 |
"sliding_window": null,
|
| 26 |
"tie_word_embeddings": false,
|
| 27 |
-
"
|
| 28 |
-
"transformers_version": "4.55.0.dev0",
|
| 29 |
"use_cache": true,
|
| 30 |
"use_sliding_window": false,
|
| 31 |
-
"vocab_size":
|
| 32 |
}
|
|
|
|
| 4 |
],
|
| 5 |
"attention_bias": false,
|
| 6 |
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 151643,
|
| 8 |
+
"dtype": "float32",
|
| 9 |
+
"eos_token_id": 151645,
|
| 10 |
"head_dim": 128,
|
| 11 |
"hidden_act": "silu",
|
| 12 |
"hidden_size": 8,
|
| 13 |
"initializer_range": 0.02,
|
| 14 |
"intermediate_size": 32,
|
| 15 |
"layer_types": [
|
| 16 |
+
"full_attention",
|
| 17 |
+
"full_attention",
|
| 18 |
+
"full_attention",
|
| 19 |
+
"full_attention",
|
| 20 |
+
"full_attention",
|
| 21 |
+
"full_attention",
|
| 22 |
+
"full_attention",
|
| 23 |
+
"full_attention",
|
| 24 |
+
"full_attention",
|
| 25 |
+
"full_attention",
|
| 26 |
+
"full_attention",
|
| 27 |
+
"full_attention",
|
| 28 |
+
"full_attention",
|
| 29 |
+
"full_attention",
|
| 30 |
+
"full_attention",
|
| 31 |
+
"full_attention",
|
| 32 |
+
"full_attention",
|
| 33 |
+
"full_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"full_attention",
|
| 36 |
+
"full_attention",
|
| 37 |
+
"full_attention",
|
| 38 |
+
"full_attention",
|
| 39 |
+
"full_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"full_attention",
|
| 42 |
+
"full_attention",
|
| 43 |
+
"full_attention",
|
| 44 |
+
"full_attention",
|
| 45 |
+
"full_attention",
|
| 46 |
+
"full_attention",
|
| 47 |
+
"full_attention",
|
| 48 |
+
"full_attention",
|
| 49 |
+
"full_attention",
|
| 50 |
"full_attention",
|
| 51 |
"full_attention"
|
| 52 |
],
|
| 53 |
+
"max_position_embeddings": 40960,
|
| 54 |
+
"max_window_layers": 36,
|
| 55 |
"model_type": "qwen3",
|
| 56 |
"num_attention_heads": 4,
|
| 57 |
"num_hidden_layers": 2,
|
| 58 |
"num_key_value_heads": 2,
|
| 59 |
"rms_norm_eps": 1e-06,
|
| 60 |
"rope_scaling": null,
|
| 61 |
+
"rope_theta": 1000000,
|
| 62 |
"sliding_window": null,
|
| 63 |
"tie_word_embeddings": false,
|
| 64 |
+
"transformers_version": "4.57.0.dev0",
|
|
|
|
| 65 |
"use_cache": true,
|
| 66 |
"use_sliding_window": false,
|
| 67 |
+
"vocab_size": 151936
|
| 68 |
}
|
generation_config.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
-
"
|
|
|
|
|
|
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 151643,
|
| 4 |
+
"eos_token_id": 151645,
|
| 5 |
+
"transformers_version": "4.57.0.dev0"
|
| 6 |
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9cd44a4baaa372e3d60969e1d2296cb588ff47495d4bc5398351d4d674b98946
|
| 3 |
+
size 9833152
|