LAMP
Collection
5 items • Updated
Run pszmk/protein-aa-fast-tokenizer on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/pszmk/protein-aa-fast-tokenizer. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/pszmk/protein-aa-fast-tokenizer on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use pszmk/protein-aa-fast-tokenizer with Transformers:
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("pszmk/protein-aa-fast-tokenizer", device_map="auto")Fast Rust-backed tokenizer for protein sequences.
AutoTokenizerfrom transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("pszmk/protein-aa-fast-tokenizer")
# Single sequence
tokens = tokenizer("MKTLLILAVAVCSAA")
print(tokens)
# {'input_ids': [2, 16, 14, ...], 'attention_mask': [1, 1, ...]}
# Batch with padding
batch = tokenizer(
["MKTLLILAVAVCSAA", "ACDEFGHIK"],
padding=True,
return_tensors="pt",
)
| ID | Token | Description |
|---|---|---|
| 0 | <PAD> |
Padding |
| 1 | <MASK> |
Masked token |
| 2 | <CLS> |
Classification / Start |
| 3 | <SEP> |
Separator |
| 4 | <EOS> |
End of sequence |
| 5 | <UNK> |
Unknown |
| 6-25 | A-Y | Standard amino acids |
| 26 | X | Any amino acid |
| 27 | B | Asparagine or Aspartic acid |
| 28 | Z | Glutamine or Glutamic acid |
<CLS> SEQUENCE <EOS><CLS> SEQ_A <SEP> SEQ_B <EOS>Part of the LAMP (Latent Anti-Microbial Peptides) project.