Text Generation
Transformers
Safetensors
udream
Mixture of Experts
mixture-of-experts
ukrainian
nope
sliding-window-attention
from-scratch
custom_code
Instructions to use UDream/UDream-1.0-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use UDream/UDream-1.0-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="UDream/UDream-1.0-Base", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("UDream/UDream-1.0-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use UDream/UDream-1.0-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "UDream/UDream-1.0-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "UDream/UDream-1.0-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/UDream/UDream-1.0-Base
- SGLang
How to use UDream/UDream-1.0-Base 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 "UDream/UDream-1.0-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "UDream/UDream-1.0-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "UDream/UDream-1.0-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "UDream/UDream-1.0-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use UDream/UDream-1.0-Base with Docker Model Runner:
docker model run hf.co/UDream/UDream-1.0-Base
File size: 1,048 Bytes
dc47fb0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | {
"architectures": [
"UDreamForCausalLM"
],
"auto_map": {
"AutoConfig": "configuration_udream.UDreamConfig",
"AutoModelForCausalLM": "modeling_udream.UDreamForCausalLM"
},
"bos_token_id": 1,
"cond_dim": 256,
"d_model": 2048,
"dense_d_ff": 5632,
"dropout": 0.0,
"dtype": "bfloat16",
"eos_token_id": 2,
"expert_d_ff": 768,
"global_every": 6,
"head_dim": 128,
"hidden_size": 2048,
"hormone_dropout": 0.1,
"init_std": 0.02,
"lb_loss": 0.01,
"max_position_embeddings": 32768,
"model_type": "udream",
"moe_top_k": 6,
"n_dense_first": 2,
"n_dense_last": 2,
"n_experts": 32,
"n_heads": 16,
"n_hormones": 8,
"n_kv_heads": 4,
"n_layers": 26,
"num_attention_heads": 16,
"num_hidden_layers": 26,
"num_key_value_heads": 4,
"pad_token_id": 0,
"rms_eps": 1e-05,
"rope_theta": 10000.0,
"shared_d_ff": 2048,
"tie_embeddings": true,
"tie_word_embeddings": true,
"transformers_version": "5.16.1",
"unk_token_id": 3,
"vocab_size": 64128,
"window": 512,
"z_loss": 0.0001
}
|