Feature Extraction
Transformers
PyTorch
Safetensors
English
bert
token-classification
text-embeddings-inference
Instructions to use bioscan-ml/BarcodeBERT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bioscan-ml/BarcodeBERT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="bioscan-ml/BarcodeBERT")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("bioscan-ml/BarcodeBERT") model = AutoModelForTokenClassification.from_pretrained("bioscan-ml/BarcodeBERT", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -28,7 +28,7 @@ dna_seq = 'ACGCGCTGACGCATCAGCATACGA'
|
|
| 28 |
input_seq = tokenizer(dna_seq, return_tensors = 'pt')['input_ids']
|
| 29 |
|
| 30 |
# Pass through the model
|
| 31 |
-
output = model(input_seq)['hidden_states'][-1]
|
| 32 |
|
| 33 |
# Compute Global Average Pooling
|
| 34 |
features = output.mean(1)
|
|
|
|
| 28 |
input_seq = tokenizer(dna_seq, return_tensors = 'pt')['input_ids']
|
| 29 |
|
| 30 |
# Pass through the model
|
| 31 |
+
output = model(input_seq.unsqueeze(0))['hidden_states'][-1]
|
| 32 |
|
| 33 |
# Compute Global Average Pooling
|
| 34 |
features = output.mean(1)
|