Text Generation
Transformers
Safetensors
Upper Grand Valley Dani
llama
genomic
text-generation-inference
Instructions to use HuggingFaceBio/Carbon-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HuggingFaceBio/Carbon-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HuggingFaceBio/Carbon-3B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HuggingFaceBio/Carbon-3B") model = AutoModelForCausalLM.from_pretrained("HuggingFaceBio/Carbon-3B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use HuggingFaceBio/Carbon-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HuggingFaceBio/Carbon-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceBio/Carbon-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/HuggingFaceBio/Carbon-3B
- SGLang
How to use HuggingFaceBio/Carbon-3B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "HuggingFaceBio/Carbon-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceBio/Carbon-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "HuggingFaceBio/Carbon-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceBio/Carbon-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use HuggingFaceBio/Carbon-3B with Docker Model Runner:
docker model run hf.co/HuggingFaceBio/Carbon-3B
Update README.md
Browse files
README.md
CHANGED
|
@@ -207,22 +207,21 @@ Below we highlight the three short-context probes for which we report headline n
|
|
| 207 |
|
| 208 |
### Downstream tasks
|
| 209 |
|
| 210 |
-
| Category | Metric (%) | Carbon 3B | GENERator-v2 3B | Evo2 7B
|
| 211 |
-
|---|---|---|---|---|
|
| 212 |
-
| Generative |
|
| 213 |
-
| Variant effect prediction | BRCA2
|
| 214 |
-
| | TraitGym Mendelian
|
| 215 |
-
| | ClinVar coding
|
| 216 |
-
| | ClinVar non-coding
|
| 217 |
-
| Perturbation |
|
| 218 |
-
| |
|
| 219 |
|
| 220 |
Carbon-3B is competitive with Evo2-7B while being much faster to run.
|
| 221 |
-
> TODO: update TATA v2 and SYN v2 scores with the new results
|
| 222 |
|
| 223 |
### Long-context retrieval (Genome-NIAH)
|
| 224 |
|
| 225 |
-
[
|
| 226 |
|
| 227 |
Below are the scores on `niah`:
|
| 228 |
| Context length | Carbon 3B 32k (native / YaRN 4Γ) | GENERator-v2 3B | Evo2-7B |
|
|
@@ -231,8 +230,7 @@ Below are the scores on `niah`:
|
|
| 231 |
| 32 k tokens (196 kbp) | 0.55 / 0.90 | β | 0.95 |
|
| 232 |
| 64 k tokens (393 kbp) | β / 0.79 | β | 0.80 |
|
| 233 |
|
| 234 |
-
Sample sizes: Carbon & GENERator n=500. Evo2-7B n=150 at 16k, n=100 at 32k, n=
|
| 235 |
-
> TODO: run more 64k samples for Evo2 7B
|
| 236 |
|
| 237 |
- **4Γ longer effective context than Generator-v2-3B.** Generator-v2-3B caps at 16 k tokens (β 98 kbp). Carbon-3B has a native context of 32 k tokens (β 197 kbp) and extends to 65,536 tokens (β 393 kbp) at inference time with YaRN. It matches Generator-v2-3B on `niah` at 98 kbp.
|
| 238 |
- **Matches Evo2-7B (1 M context) on `niah` at 393 kbp** (64 k tokens) under YaRN, despite being substantially smaller.
|
|
@@ -289,6 +287,7 @@ The optimizer is AdamW (Ξ²β = 0.9, Ξ²β = 0.95, Ξ΅ = 1e-8, weight decay = 0.1
|
|
| 289 |
|
| 290 |
## Limitations
|
| 291 |
|
|
|
|
| 292 |
- **Primarily eukaryotic training.** Carbon-3B is trained mostly on eukaryotic genomic and transcript sequence; the pre-training mixture deliberately includes a smaller prokaryotic component (GTDB bacterial genomes) so that continual pre-training on prokaryotic data remains straightforward. Despite this modest prokaryotic share, we observed consistent gains on prokaryotic sequence recovery throughout training, and Carbon-3B already **matches [GENERator-v2-prokaryote-3B](https://huggingface.co/GenerTeam/GENERator-v2-prokaryote-3b-base)** β a model trained specifically on prokaryotes β on the prokaryote sequence-recovery split. We expect that a short continued-training phase on prokaryotic data would deliver substantially stronger prokaryote-specific performance.
|
| 293 |
- **YaRN beyond 64 k tokens degrades.** YaRN reliably extends Carbon-3B to 65,536 tokens (β 393 kbp) at inference time with `factor=4`. Pushing further to 128 k tokens (β 786 kbp) causes retrieval quality to drop sharply in our long-context benchmarks.
|
| 294 |
|
|
|
|
| 207 |
|
| 208 |
### Downstream tasks
|
| 209 |
|
| 210 |
+
| Category | Metric (%) | Carbon 3B | GENERator-v2 3B | Evo2 7B |
|
| 211 |
+
|---|---|---|---|---|
|
| 212 |
+
| Generative | Sequence Recovery eukaryote | **61.54** | 58.56 | <u>59.86</u> |
|
| 213 |
+
| Variant effect prediction | BRCA2 | **84.63** | 81.93 | <u>83.52</u> |
|
| 214 |
+
| | TraitGym Mendelian | <u>33.65</u> | 27.91 | **37.78** |
|
| 215 |
+
| | ClinVar coding (24 kb) | <u>92.89</u> | 91.55 | **93.33** |
|
| 216 |
+
| | ClinVar non-coding (24 kb) | **91.14** | <u>90.13</u> | 89.79 |
|
| 217 |
+
| Perturbation | Nucleotide triplet-expansion | <u>85.20</u> | 83.06 | **88.43** |
|
| 218 |
+
| | Synonymous codon | <u>88.89</u> | 87.03 | **91.59** |
|
| 219 |
|
| 220 |
Carbon-3B is competitive with Evo2-7B while being much faster to run.
|
|
|
|
| 221 |
|
| 222 |
### Long-context retrieval (Genome-NIAH)
|
| 223 |
|
| 224 |
+
[Genomic-NIAH](https://huggingface.co/datasets/HuggingFaceBio/genomic-niah) is a long context benchmark, inspired from NIAH and RULER benchmarks for English. The model needs to retrieves a random 24 bp VALUE planted in a real-genome haystack at one of five depths, evaluated at six context lengths from 24 kbp to 786 kbp. The benchmark contains 500 examples per (task, context) cell.
|
| 225 |
|
| 226 |
Below are the scores on `niah`:
|
| 227 |
| Context length | Carbon 3B 32k (native / YaRN 4Γ) | GENERator-v2 3B | Evo2-7B |
|
|
|
|
| 230 |
| 32 k tokens (196 kbp) | 0.55 / 0.90 | β | 0.95 |
|
| 231 |
| 64 k tokens (393 kbp) | β / 0.79 | β | 0.80 |
|
| 232 |
|
| 233 |
+
Sample sizes: Carbon & GENERator n=500. Evo2-7B n=150 at 16k, n=100 at 32k, n=100 at 64k due to the slow inference speed.
|
|
|
|
| 234 |
|
| 235 |
- **4Γ longer effective context than Generator-v2-3B.** Generator-v2-3B caps at 16 k tokens (β 98 kbp). Carbon-3B has a native context of 32 k tokens (β 197 kbp) and extends to 65,536 tokens (β 393 kbp) at inference time with YaRN. It matches Generator-v2-3B on `niah` at 98 kbp.
|
| 236 |
- **Matches Evo2-7B (1 M context) on `niah` at 393 kbp** (64 k tokens) under YaRN, despite being substantially smaller.
|
|
|
|
| 287 |
|
| 288 |
## Limitations
|
| 289 |
|
| 290 |
+
- β οΈ **Genetic data is highly sensitive.** Depending on how this model is used (local download, inference API/endpoints, third-party inference providers, Spaces demos or others), input and output data may be processed or handled differently by different providers or space owners. Please make sure you understand and agree with how your data is handled before using the model.
|
| 291 |
- **Primarily eukaryotic training.** Carbon-3B is trained mostly on eukaryotic genomic and transcript sequence; the pre-training mixture deliberately includes a smaller prokaryotic component (GTDB bacterial genomes) so that continual pre-training on prokaryotic data remains straightforward. Despite this modest prokaryotic share, we observed consistent gains on prokaryotic sequence recovery throughout training, and Carbon-3B already **matches [GENERator-v2-prokaryote-3B](https://huggingface.co/GenerTeam/GENERator-v2-prokaryote-3b-base)** β a model trained specifically on prokaryotes β on the prokaryote sequence-recovery split. We expect that a short continued-training phase on prokaryotic data would deliver substantially stronger prokaryote-specific performance.
|
| 292 |
- **YaRN beyond 64 k tokens degrades.** YaRN reliably extends Carbon-3B to 65,536 tokens (β 393 kbp) at inference time with `factor=4`. Pushing further to 128 k tokens (β 786 kbp) causes retrieval quality to drop sharply in our long-context benchmarks.
|
| 293 |
|