Text Generation
Transformers
Safetensors
laguna
code
distillation
moe-to-dense
conversational
custom_code
Instructions to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="poolside-laguna-hackathon/laguna-xs2-dense-stage2", trust_remote_code=True) 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("poolside-laguna-hackathon/laguna-xs2-dense-stage2", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("poolside-laguna-hackathon/laguna-xs2-dense-stage2", trust_remote_code=True, 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 poolside-laguna-hackathon/laguna-xs2-dense-stage2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "poolside-laguna-hackathon/laguna-xs2-dense-stage2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "poolside-laguna-hackathon/laguna-xs2-dense-stage2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/poolside-laguna-hackathon/laguna-xs2-dense-stage2
- SGLang
How to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 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 "poolside-laguna-hackathon/laguna-xs2-dense-stage2" \ --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": "poolside-laguna-hackathon/laguna-xs2-dense-stage2", "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 "poolside-laguna-hackathon/laguna-xs2-dense-stage2" \ --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": "poolside-laguna-hackathon/laguna-xs2-dense-stage2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use poolside-laguna-hackathon/laguna-xs2-dense-stage2 with Docker Model Runner:
docker model run hf.co/poolside-laguna-hackathon/laguna-xs2-dense-stage2
Download config.json from poolside-laguna-hackathon/laguna-xs2-dense-stage2: direct link, hf CLI and curl.
- Browser
- Download file 3.47 kB
-
https://huggingface.co/poolside-laguna-hackathon/laguna-xs2-dense-stage2/resolve/main/config.json
- Command line
-
hf download hf://poolside-laguna-hackathon/laguna-xs2-dense-stage2/config.json
-
curl -L -o config.json https://huggingface.co/poolside-laguna-hackathon/laguna-xs2-dense-stage2/resolve/main/config.json
3.47 kB
| { | |
| "architectures": [ | |
| "LagunaForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "auto_map": { | |
| "AutoConfig": "configuration_laguna.LagunaConfig", | |
| "AutoModelForCausalLM": "modeling_laguna.LagunaForCausalLM" | |
| }, | |
| "bos_token_id": 2, | |
| "dtype": "bfloat16", | |
| "eos_token_id": [ | |
| 2, | |
| 24 | |
| ], | |
| "gating": true, | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "hidden_size": 2048, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 8192, | |
| "layer_types": [ | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention" | |
| ], | |
| "max_position_embeddings": 262144, | |
| "mlp_layer_types": [ | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense", | |
| "dense" | |
| ], | |
| "model_type": "laguna", | |
| "moe_apply_router_weight_on_input": false, | |
| "moe_intermediate_size": 512, | |
| "moe_routed_scaling_factor": 2.5, | |
| "moe_router_logit_softcapping": 0.0, | |
| "num_attention_heads": 48, | |
| "num_attention_heads_per_layer": [ | |
| 48, | |
| 64, | |
| 64, | |
| 64, | |
| 48, | |
| 64, | |
| 64, | |
| 64, | |
| 48, | |
| 64, | |
| 64, | |
| 64, | |
| 48, | |
| 64, | |
| 64, | |
| 64, | |
| 48, | |
| 64, | |
| 64, | |
| 64, | |
| 48, | |
| 64, | |
| 64, | |
| 64, | |
| 48, | |
| 64, | |
| 64, | |
| 64, | |
| 48, | |
| 64, | |
| 64, | |
| 64, | |
| 48, | |
| 64, | |
| 64, | |
| 64, | |
| 48, | |
| 64, | |
| 64, | |
| 64 | |
| ], | |
| "num_experts": 256, | |
| "num_experts_per_tok": 8, | |
| "num_hidden_layers": 40, | |
| "num_key_value_heads": 8, | |
| "output_router_logits": false, | |
| "pad_token_id": 9, | |
| "partial_rotary_factor": null, | |
| "rms_norm_eps": 1e-06, | |
| "rope_parameters": { | |
| "full_attention": { | |
| "attention_factor": 1.0, | |
| "beta_fast": 64.0, | |
| "beta_slow": 1.0, | |
| "factor": 64.0, | |
| "original_max_position_embeddings": 4096, | |
| "partial_rotary_factor": 0.5, | |
| "rope_theta": 500000.0, | |
| "rope_type": "yarn" | |
| }, | |
| "sliding_attention": { | |
| "partial_rotary_factor": 1.0, | |
| "rope_theta": 10000.0, | |
| "rope_type": "default" | |
| } | |
| }, | |
| "router_aux_loss_coef": 0.0, | |
| "shared_expert_intermediate_size": 512, | |
| "sliding_window": 512, | |
| "tie_word_embeddings": false, | |
| "transformers_version": "5.9.0", | |
| "use_cache": true, | |
| "vocab_size": 100352 | |
| } | |