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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("isyslab/DNAFlash", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from isyslab/DNAFlash: direct link, hf CLI and curl.
- Browser
- Download file 1 kB
-
https://huggingface.co/isyslab/DNAFlash/resolve/main/README.md
- Command line
-
hf download hf://isyslab/DNAFlash/README.md
-
curl -L -o README.md https://huggingface.co/isyslab/DNAFlash/resolve/main/README.md
1 kB
| license: mit | |
| tags: | |
| - biology | |
| - genomics | |
| - long-context | |
| library_name: transformers | |
| # DNAFlash | |
| ## Abouts | |
| ### Dependencies | |
| ``` | |
| rotary_embedding_torch | |
| einops | |
| ``` | |
| ## How to use | |
| ### Simple example: embedding | |
| ```python | |
| 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 | |