Instructions to use fla-hub/gla-1.3B-100B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fla-hub/gla-1.3B-100B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fla-hub/gla-1.3B-100B")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("fla-hub/gla-1.3B-100B", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use fla-hub/gla-1.3B-100B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fla-hub/gla-1.3B-100B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fla-hub/gla-1.3B-100B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/fla-hub/gla-1.3B-100B
- SGLang
How to use fla-hub/gla-1.3B-100B 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 "fla-hub/gla-1.3B-100B" \ --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": "fla-hub/gla-1.3B-100B", "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 "fla-hub/gla-1.3B-100B" \ --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": "fla-hub/gla-1.3B-100B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use fla-hub/gla-1.3B-100B with Docker Model Runner:
docker model run hf.co/fla-hub/gla-1.3B-100B
GLA 1.3B-100B
This repository contains the gla-1.3B-100B model, a 1.3B parameter variant trained on 100B tokens, which was presented in the paper Gated Linear Attention Transformers with Hardware-Efficient Training.
Usage
This model can be easily loaded and used for text generation tasks with the Hugging Face transformers library:
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load the tokenizer and model
model_id = "fla-hub/gla-1.3B-100B"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True)
# Example for text generation
prompt = "Hello, my name is"
inputs = tokenizer(prompt, return_tensors="pt")
# Generate text
outputs = model.generate(**inputs, max_new_tokens=50, do_sample=True, top_k=50, top_p=0.95, temperature=0.7)
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(generated_text)
Paper and Citation
If you find this work useful, please consider citing the original paper:
Gated Linear Attention Transformers with Hardware-Efficient Training
@article{li2025systematic,
title={Gated Linear Attention Transformers with Hardware-Efficient Training},
author={Songlin Yang, Bailin Wang, Yikang Shen, Rameswar Panda, Yoon Kim},
journal={arXiv preprint arXiv:2312.06635},
year={2023},
}
Code
The official codebase for the models and research, including training scripts and other checkpoints, can be found on GitHub:
- Downloads last month
- 6,391