Text Generation
Transformers
Safetensors
Chinese
English
retnet_hf
retnet
retention
from-scratch
custom_code
Instructions to use Ayaka157/RetNet-100M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ayaka157/RetNet-100M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ayaka157/RetNet-100M", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Ayaka157/RetNet-100M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Ayaka157/RetNet-100M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ayaka157/RetNet-100M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ayaka157/RetNet-100M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Ayaka157/RetNet-100M
- SGLang
How to use Ayaka157/RetNet-100M 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 "Ayaka157/RetNet-100M" \ --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": "Ayaka157/RetNet-100M", "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 "Ayaka157/RetNet-100M" \ --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": "Ayaka157/RetNet-100M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Ayaka157/RetNet-100M with Docker Model Runner:
docker model run hf.co/Ayaka157/RetNet-100M
Download config.json from Ayaka157/RetNet-100M: direct link, hf CLI and curl.
- Browser
- Download file 682 Bytes
-
https://huggingface.co/Ayaka157/RetNet-100M/resolve/main/config.json
- Command line
-
hf download hf://Ayaka157/RetNet-100M/config.json
-
curl -L -o config.json https://huggingface.co/Ayaka157/RetNet-100M/resolve/main/config.json
682 Bytes
| { | |
| "architectures": [ | |
| "RetNetForCausalLM" | |
| ], | |
| "checkpoint_layers": -1, | |
| "d_model": 768, | |
| "dropout": 0.1, | |
| "dtype": "float32", | |
| "embed_scale": null, | |
| "ffn_dim": 1536, | |
| "growth_old_dim": null, | |
| "model_type": "retnet_hf", | |
| "norm_eps": 1e-05, | |
| "num_heads": 12, | |
| "num_layers": 12, | |
| "prompt_loss_weight": 0.1, | |
| "tie_weights": true, | |
| "transformers_version": "4.57.6", | |
| "use_gla": false, | |
| "use_growth_ln": false, | |
| "use_swiglu": false, | |
| "value_dim": 1536, | |
| "vocab_size": 20000, | |
| "auto_map": { | |
| "AutoConfig": "modeling_retnet.RetNetHFConfig", | |
| "AutoModelForCausalLM": "modeling_retnet.RetNetForCausalLM" | |
| }, | |
| "mode": "parallel" | |
| } |