Instructions to use vesteinn/gpt2-dna with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vesteinn/gpt2-dna with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vesteinn/gpt2-dna")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("vesteinn/gpt2-dna") model = AutoModelForCausalLM.from_pretrained("vesteinn/gpt2-dna") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use vesteinn/gpt2-dna with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vesteinn/gpt2-dna" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vesteinn/gpt2-dna", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/vesteinn/gpt2-dna
- SGLang
How to use vesteinn/gpt2-dna 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 "vesteinn/gpt2-dna" \ --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": "vesteinn/gpt2-dna", "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 "vesteinn/gpt2-dna" \ --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": "vesteinn/gpt2-dna", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use vesteinn/gpt2-dna with Docker Model Runner:
docker model run hf.co/vesteinn/gpt2-dna
Update README.md
Browse files
README.md
CHANGED
|
@@ -44,7 +44,6 @@ The tokenizer is a minimal GPT-2-style vocabulary:
|
|
| 44 |
|
| 45 |
* Implemented via `GPT2TokenizerFast`
|
| 46 |
* Merges file is empty (no BPE applied)
|
| 47 |
-
* Saved to the `dna_tokenizer/` directory for reuse
|
| 48 |
|
| 49 |
---
|
| 50 |
|
|
@@ -53,9 +52,7 @@ The tokenizer is a minimal GPT-2-style vocabulary:
|
|
| 53 |
* Original dataset is cleaned to keep only `A`, `C`, `G`, `T`
|
| 54 |
* Sequences are chunked into segments of length 1024
|
| 55 |
* Very short chunks (<200bp) are discarded
|
| 56 |
-
*
|
| 57 |
-
|
| 58 |
-
If no validation set is provided, a 10% split is made from the training set.
|
| 59 |
|
| 60 |
---
|
| 61 |
|
|
|
|
| 44 |
|
| 45 |
* Implemented via `GPT2TokenizerFast`
|
| 46 |
* Merges file is empty (no BPE applied)
|
|
|
|
| 47 |
|
| 48 |
---
|
| 49 |
|
|
|
|
| 52 |
* Original dataset is cleaned to keep only `A`, `C`, `G`, `T`
|
| 53 |
* Sequences are chunked into segments of length 1024
|
| 54 |
* Very short chunks (<200bp) are discarded
|
| 55 |
+
* A 10% split validation is made from the training set.
|
|
|
|
|
|
|
| 56 |
|
| 57 |
---
|
| 58 |
|