Token Classification
Transformers
Safetensors
generanno
dna
genomics
biology
genome-annotation
custom_code
Instructions to use HuggingFaceBio/Carbon-A-1.2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HuggingFaceBio/Carbon-A-1.2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="HuggingFaceBio/Carbon-A-1.2B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForTokenClassification model = AutoModelForTokenClassification.from_pretrained("HuggingFaceBio/Carbon-A-1.2B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Set the default inference batch size to 1
Browse files
annotation_pipeline/run_annotation.sh
CHANGED
|
@@ -21,7 +21,7 @@ CODON_TABLE=""
|
|
| 21 |
VITERBI_BACKEND="auto"
|
| 22 |
|
| 23 |
GPU_COUNT="-1"
|
| 24 |
-
BATCH_SIZE="
|
| 25 |
DISPATCH_CHUNK_SIZE="4"
|
| 26 |
ATTN_IMPLEMENTATION="flash_attention_2"
|
| 27 |
SKIP_INFERENCE=0
|
|
@@ -59,7 +59,7 @@ Input and output:
|
|
| 59 |
|
| 60 |
Inference:
|
| 61 |
--gpu-count N GPUs to use; -1 selects all available GPUs (default: -1).
|
| 62 |
-
--batch-size N Inference batch size (default:
|
| 63 |
--dispatch-chunk-size N Per-GPU dispatch chunk size (default: 4).
|
| 64 |
--attn-implementation NAME flash_attention_2 (default; used for all reported results)
|
| 65 |
or sdpa (needs no flash-attn package; not bit-identical).
|
|
|
|
| 21 |
VITERBI_BACKEND="auto"
|
| 22 |
|
| 23 |
GPU_COUNT="-1"
|
| 24 |
+
BATCH_SIZE="1"
|
| 25 |
DISPATCH_CHUNK_SIZE="4"
|
| 26 |
ATTN_IMPLEMENTATION="flash_attention_2"
|
| 27 |
SKIP_INFERENCE=0
|
|
|
|
| 59 |
|
| 60 |
Inference:
|
| 61 |
--gpu-count N GPUs to use; -1 selects all available GPUs (default: -1).
|
| 62 |
+
--batch-size N Inference batch size (default: 1).
|
| 63 |
--dispatch-chunk-size N Per-GPU dispatch chunk size (default: 4).
|
| 64 |
--attn-implementation NAME flash_attention_2 (default; used for all reported results)
|
| 65 |
or sdpa (needs no flash-attn package; not bit-identical).
|
annotation_pipeline/src/model_inference.py
CHANGED
|
@@ -73,7 +73,7 @@ def parse_arguments() -> argparse.Namespace:
|
|
| 73 |
),
|
| 74 |
)
|
| 75 |
parser.add_argument(
|
| 76 |
-
"--batch_size", type=int, default=
|
| 77 |
)
|
| 78 |
parser.add_argument(
|
| 79 |
"--dispatch_chunk_size",
|
|
|
|
| 73 |
),
|
| 74 |
)
|
| 75 |
parser.add_argument(
|
| 76 |
+
"--batch_size", type=int, default=1, help="Batch size for inference"
|
| 77 |
)
|
| 78 |
parser.add_argument(
|
| 79 |
"--dispatch_chunk_size",
|