Instructions to use dogeplusplus/duo-laguna-adapter-smoke with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dogeplusplus/duo-laguna-adapter-smoke with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dogeplusplus/duo-laguna-adapter-smoke", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dogeplusplus/duo-laguna-adapter-smoke", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("dogeplusplus/duo-laguna-adapter-smoke", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use dogeplusplus/duo-laguna-adapter-smoke with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dogeplusplus/duo-laguna-adapter-smoke" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dogeplusplus/duo-laguna-adapter-smoke", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dogeplusplus/duo-laguna-adapter-smoke
- SGLang
How to use dogeplusplus/duo-laguna-adapter-smoke 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 "dogeplusplus/duo-laguna-adapter-smoke" \ --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": "dogeplusplus/duo-laguna-adapter-smoke", "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 "dogeplusplus/duo-laguna-adapter-smoke" \ --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": "dogeplusplus/duo-laguna-adapter-smoke", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dogeplusplus/duo-laguna-adapter-smoke with Docker Model Runner:
docker model run hf.co/dogeplusplus/duo-laguna-adapter-smoke
DuoAttention Laguna Adapter
This repository contains learned DuoAttention attention-head weights and custom
loading code for poolside/Laguna-XS.2. It intentionally does not include the full
Laguna base-model weights or tokenizer files.
Install optional tokenizer dependencies if needed:
pip install sentencepiece tiktoken
Load the tokenizer from the base Laguna model and the patched model from this adapter repository:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
adapter_repo = "dogeplusplus/duo-laguna-adapter-smoke"
base_model = "poolside/Laguna-XS.2"
tokenizer = AutoTokenizer.from_pretrained(
base_model,
trust_remote_code=True,
token=True,
)
model = AutoModelForCausalLM.from_pretrained(
adapter_repo,
trust_remote_code=True,
token=True,
torch_dtype="auto",
device_map="auto",
)
prompt = "The capital of France is"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
generated = model.generate(**inputs, max_new_tokens=32)
print(tokenizer.decode(generated[0], skip_special_tokens=True))
Use token=True after running hf auth login, or pass a token string directly
when loading private or gated repositories.
- Downloads last month
- 47
Model tree for dogeplusplus/duo-laguna-adapter-smoke
Base model
poolside/Laguna-XS.2