Instructions to use tmbj-aidd/aptagpt-bcma with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tmbj-aidd/aptagpt-bcma with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tmbj-aidd/aptagpt-bcma")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tmbj-aidd/aptagpt-bcma") model = AutoModelForCausalLM.from_pretrained("tmbj-aidd/aptagpt-bcma", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tmbj-aidd/aptagpt-bcma with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tmbj-aidd/aptagpt-bcma" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tmbj-aidd/aptagpt-bcma", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/tmbj-aidd/aptagpt-bcma
- SGLang
How to use tmbj-aidd/aptagpt-bcma 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 "tmbj-aidd/aptagpt-bcma" \ --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": "tmbj-aidd/aptagpt-bcma", "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 "tmbj-aidd/aptagpt-bcma" \ --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": "tmbj-aidd/aptagpt-bcma", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use tmbj-aidd/aptagpt-bcma with Docker Model Runner:
docker model run hf.co/tmbj-aidd/aptagpt-bcma
AptaGPT
AptaGPT is a generative pre-trained language model for aptamer design. The model focuses on the generation of a new sequence space of aptamers, trained and fine-tuned using the third and sixth round of SELEX data for B cell maturation antigen (BCMA).
Dataset
AptaGPT was pre-trained using a large dataset consisting of 108,229,900 sequences from the third round of the SELEX process targeting BCMA. This extensive dataset provided a robust foundation for learning generalized patterns in aptamer sequences. For fine-tuning, the model utilized 9,350 sequences from the sixth round of SELEX. All aptamer sequences used for both pre-training and fine-tuning are 35 nucleotides in length.
Requirements
Before running the AptaGPT model, the following Python dependencies need to be installed:
pip install transformers sentencepiece
Usage Examples
To load the model form hugging face:
from transformers import pipeline
aptagpt = pipeline('text-generation', model="tmbj-aidd/aptagpt-bcma")
To generate aptamer sequences:
sequences = aptagpt("<|endoftext|>",
max_length=15,
do_sample=True,
top_k=700,
repetition_penalty=1.2,
num_return_sequences=10,
)
print(sequences)
- Downloads last month
- 12