Feature Extraction
Transformers
Safetensors
flash_transformer
biology
genomics
long-context
custom_code
Instructions to use isyslab/DNAFlash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use isyslab/DNAFlash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="isyslab/DNAFlash", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("isyslab/DNAFlash", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
DNAFlash
Abouts
Dependencies
rotary_embedding_torch
einops
How to use
Simple example: embedding
import torch
from transformers import AutoTokenizer, AutoModel
# Load the tokenizer and model using the pretrained model name
tokenizer = AutoTokenizer.from_pretrained("isyslab/DNAFlash")
model = AutoModel.from_pretrained("isyslab/DNAFlash", trust_remote_code=True)
# Define input sequences
sequences = [
"GAATTCCATGAGGCTATAGAATAATCTAAGAGAAATATATATATATTGAAAAAAAAAAAAAAAAAAAAAAAGGGG"
]
# Tokenize the sequences
inputs = tokenizer(
sequences,
add_special_tokens=True,
return_tensors="pt",
padding=True,
truncation=True
)
# Perform a forward pass through the model to obtain the outputs, including hidden states
with torch.inference_mode():
outputs = model(input_ids=inputs["input_ids"], attention_mask=inputs["attention_mask"])
Citation
- Downloads last month
- 5