RITA 🧿
Collection
A suite of autoregressive generative models for protein sequences, with up to 1.2Bparameters, trained on over 280 million protein sequences. • 4 items • Updated • 1
How to use lightonai/RITA_l with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="lightonai/RITA_l", trust_remote_code=True) # Load model directly
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("lightonai/RITA_l", trust_remote_code=True, dtype="auto")How to use lightonai/RITA_l with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "lightonai/RITA_l"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "lightonai/RITA_l",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/lightonai/RITA_l
How to use lightonai/RITA_l with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "lightonai/RITA_l" \
--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": "lightonai/RITA_l",
"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 "lightonai/RITA_l" \
--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": "lightonai/RITA_l",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use lightonai/RITA_l with Docker Model Runner:
docker model run hf.co/lightonai/RITA_l
YAML Metadata Error:"language" with value "protein" is not valid. It must be an ISO 639-1, 639-2 or 639-3 code (two/three letters), or a special value like "code", "multilingual". If you want to use BCP-47 identifiers, you can specify them in language_bcp47.
RITA is a family of autoregressive protein models, developed by a collaboration of Lighton, the OATML group at Oxford, and the Debbie Marks Lab at Harvard.
| Model | #Params | d_model | layers | lm loss uniref-100 |
|---|---|---|---|---|
| Small | 85M | 768 | 12 | 2.31 |
| Medium | 300M | 1024 | 24 | 2.01 |
| Large | 680M | 1536 | 24 | 1.82 |
| XLarge | 1.2B | 2048 | 24 | 1.70 |
For full results see our preprint: https://arxiv.org/abs/2205.05789
Instantiate a model like so:
from transformers import AutoModel, AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("lightonai/RITA_l, trust_remote_code=True")
tokenizer = AutoTokenizer.from_pretrained("lightonai/RITA_l")
for generation we support pipelines:
from transformers import pipeline
rita_gen = pipeline('text-generation', model=model, tokenizer=tokenizer)
sequences = rita_gen("MAB", max_length=20, do_sample=True, top_k=950, repetition_penalty=1.2,
num_return_sequences=2, eos_token_id=2)
for seq in sequences:
print(f"seq: {seq['generated_text'].replace(' ', '')}")
@article{hesslow2022rita,
title={RITA: a Study on Scaling Up Generative Protein Sequence Models},
author={Hesslow, Daniel and Zanichelli, Niccol{\'o} and Notin, Pascal and Poli, Iacopo and Marks, Debora},
journal={arXiv preprint arXiv:2205.05789},
year={2022}
}