CyclicFlowAttention
Collection
Pretrained Cyclic Flow Attention (CyFA) language models. • 4 items • Updated
How to use cyxxxxxxxxxx/cyfa-800M-30B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="cyxxxxxxxxxx/cyfa-800M-30B") # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("cyxxxxxxxxxx/cyfa-800M-30B", device_map="auto")How to use cyxxxxxxxxxx/cyfa-800M-30B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "cyxxxxxxxxxx/cyfa-800M-30B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "cyxxxxxxxxxx/cyfa-800M-30B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/cyxxxxxxxxxx/cyfa-800M-30B
How to use cyxxxxxxxxxx/cyfa-800M-30B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "cyxxxxxxxxxx/cyfa-800M-30B" \
--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": "cyxxxxxxxxxx/cyfa-800M-30B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "cyxxxxxxxxxx/cyfa-800M-30B" \
--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": "cyxxxxxxxxxx/cyfa-800M-30B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use cyxxxxxxxxxx/cyfa-800M-30B with Docker Model Runner:
docker model run hf.co/cyxxxxxxxxxx/cyfa-800M-30B
Cyclic Flow Attention (CyFA), an 800M-parameter base language model trained on 30B tokens from SlimPajama.
| Layers | Hidden size | Heads | Head dimension | Training context |
|---|---|---|---|---|
| 24 | 1536 | 6 | 256 | 2048 |
Install CyclicFlowAttention, then load the model:
import torch
import cyclic_flow_attention
from transformers import AutoModelForCausalLM, AutoTokenizer
checkpoint = "cyxxxxxxxxxx/cyfa-800M-30B"
tokenizer = AutoTokenizer.from_pretrained(checkpoint)
model = AutoModelForCausalLM.from_pretrained(
checkpoint, dtype=torch.bfloat16,
).cuda().eval()
inputs = tokenizer("The library opens at", return_tensors="pt").to("cuda")
with torch.inference_mode():
output = model.generate(
**inputs, max_new_tokens=64, do_sample=False,
pad_token_id=tokenizer.pad_token_id,
)
print(tokenizer.decode(output[0], skip_special_tokens=True))