Instructions to use Ayaka157/RetNet-0.5B-ep2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ayaka157/RetNet-0.5B-ep2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ayaka157/RetNet-0.5B-ep2", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Ayaka157/RetNet-0.5B-ep2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Ayaka157/RetNet-0.5B-ep2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ayaka157/RetNet-0.5B-ep2" # 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-0.5B-ep2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Ayaka157/RetNet-0.5B-ep2
- SGLang
How to use Ayaka157/RetNet-0.5B-ep2 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-0.5B-ep2" \ --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-0.5B-ep2", "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-0.5B-ep2" \ --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-0.5B-ep2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Ayaka157/RetNet-0.5B-ep2 with Docker Model Runner:
docker model run hf.co/Ayaka157/RetNet-0.5B-ep2
RetNet-0.5B, epoch 2
Intermediate checkpoint of the three-leg run. Validation loss 1.9865. The final model is RetNet-0.5B at 1.9459.
Same architecture and configuration: 504,179,896 parameters, 20 layers, d_model 1408, 22 heads,
vocab 20000, context 2048, chunk size 128.
Training
Second leg over chat_pack_v13 (552,330,489 token slots). RTX PRO 6000 96 GB, batch 16 × accum 1,
16,848 steps, 2.790 h wall clock, 54,970 tokens/s. Full cosine 1.1e-4 → 1.1e-5, warmup 500,
AdamW 8-bit, seed 1234.
Its first evaluation lands 0.0764 above epoch 1's best (2.1035) before recovering to 1.9865.
Usage
Identical to the final model — trust_remote_code=True, standard AutoTokenizer:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "Ayaka157/RetNet-0.5B-ep2"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype=torch.float32).eval()
ids = tok("<bos>ç”¨æˆ·ï¼šä½ å¥½ã€‚\n助手:")["input_ids"]
out = model.generate(torch.tensor([ids]), max_new_tokens=64, temperature=0.7)
print(tok.decode(out[0].tolist()[len(ids):]))
As in the other checkpoints, mode in config.json is parallel for inference; the training
run used chunkwise.
Evaluation numbers and the failure notes are on the final model card and in the technical report.
License
MIT.
- Downloads last month
- 251