Instructions to use tiny-random/qwen3-tp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tiny-random/qwen3-tp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tiny-random/qwen3-tp") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tiny-random/qwen3-tp") model = AutoModelForCausalLM.from_pretrained("tiny-random/qwen3-tp") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use tiny-random/qwen3-tp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tiny-random/qwen3-tp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tiny-random/qwen3-tp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tiny-random/qwen3-tp
- SGLang
How to use tiny-random/qwen3-tp 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 "tiny-random/qwen3-tp" \ --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": "tiny-random/qwen3-tp", "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 "tiny-random/qwen3-tp" \ --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": "tiny-random/qwen3-tp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tiny-random/qwen3-tp with Docker Model Runner:
docker model run hf.co/tiny-random/qwen3-tp
Upload folder using huggingface_hub
Browse files- README.md +1 -0
- config.json +0 -62
README.md
CHANGED
|
@@ -93,6 +93,7 @@ config.num_attention_heads = 8
|
|
| 93 |
config.num_hidden_layers = 2
|
| 94 |
config.max_window_layers = 1
|
| 95 |
config.tie_word_embeddings = False
|
|
|
|
| 96 |
model = AutoModelForCausalLM.from_config(
|
| 97 |
config,
|
| 98 |
torch_dtype=torch.bfloat16,
|
|
|
|
| 93 |
config.num_hidden_layers = 2
|
| 94 |
config.max_window_layers = 1
|
| 95 |
config.tie_word_embeddings = False
|
| 96 |
+
config.layer_types = ['full_attention'] * 2
|
| 97 |
model = AutoModelForCausalLM.from_config(
|
| 98 |
config,
|
| 99 |
torch_dtype=torch.bfloat16,
|
config.json
CHANGED
|
@@ -12,68 +12,6 @@
|
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
"intermediate_size": 32,
|
| 14 |
"layer_types": [
|
| 15 |
-
"full_attention",
|
| 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 |
-
"full_attention",
|
| 53 |
-
"full_attention",
|
| 54 |
-
"full_attention",
|
| 55 |
-
"full_attention",
|
| 56 |
-
"full_attention",
|
| 57 |
-
"full_attention",
|
| 58 |
-
"full_attention",
|
| 59 |
-
"full_attention",
|
| 60 |
-
"full_attention",
|
| 61 |
-
"full_attention",
|
| 62 |
-
"full_attention",
|
| 63 |
-
"full_attention",
|
| 64 |
-
"full_attention",
|
| 65 |
-
"full_attention",
|
| 66 |
-
"full_attention",
|
| 67 |
-
"full_attention",
|
| 68 |
-
"full_attention",
|
| 69 |
-
"full_attention",
|
| 70 |
-
"full_attention",
|
| 71 |
-
"full_attention",
|
| 72 |
-
"full_attention",
|
| 73 |
-
"full_attention",
|
| 74 |
-
"full_attention",
|
| 75 |
-
"full_attention",
|
| 76 |
-
"full_attention",
|
| 77 |
"full_attention",
|
| 78 |
"full_attention"
|
| 79 |
],
|
|
|
|
| 12 |
"initializer_range": 0.02,
|
| 13 |
"intermediate_size": 32,
|
| 14 |
"layer_types": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
"full_attention",
|
| 16 |
"full_attention"
|
| 17 |
],
|