Text Generation
Transformers
Safetensors
English
qwen3
medical
clinical
biomedical
radiology
from-scratch
base-model
university-of-kentucky
university-of-louisville
ccts
text-generation-inference
Instructions to use Kentucky-Open-Science/KOS-V5-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kentucky-Open-Science/KOS-V5-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kentucky-Open-Science/KOS-V5-Base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kentucky-Open-Science/KOS-V5-Base") model = AutoModelForCausalLM.from_pretrained("Kentucky-Open-Science/KOS-V5-Base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kentucky-Open-Science/KOS-V5-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kentucky-Open-Science/KOS-V5-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kentucky-Open-Science/KOS-V5-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Kentucky-Open-Science/KOS-V5-Base
- SGLang
How to use Kentucky-Open-Science/KOS-V5-Base 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 "Kentucky-Open-Science/KOS-V5-Base" \ --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": "Kentucky-Open-Science/KOS-V5-Base", "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 "Kentucky-Open-Science/KOS-V5-Base" \ --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": "Kentucky-Open-Science/KOS-V5-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Kentucky-Open-Science/KOS-V5-Base with Docker Model Runner:
docker model run hf.co/Kentucky-Open-Science/KOS-V5-Base
transformers 4.x + 5.x compatibility: dual RoPE schema (flat rope_theta + nested rope_parameters), model_input_names; verified on 4.57.1 and 5.2.0
Browse files
README.md
CHANGED
|
@@ -71,9 +71,8 @@ University of Louisville (Bird), so the code name is fitting.
|
|
| 71 |
| **Training tokens** | **235.2B** (one complete epoch over a 54-source medical/biomedical corpus) |
|
| 72 |
| **Final train loss** | ≈1.16 |
|
| 73 |
| **Context** | trained at **24,576** tokens (whole-document); `max_position_embeddings` **32,768** |
|
| 74 |
-
| **RoPE** | standard 1D, **θ = 25,000**
|
| 75 |
| **Tokenizer** | custom **32k byte-level BPE** ("v5-32k"), `add_bos_token=False`, single special token `<|endoftext|>` (id 0 = eos/bos/pad) |
|
| 76 |
-
| **Objective** | **pure cross-entropy** (no auxiliary/geometric losses; no SigReg, no STP, no MTP) |
|
| 77 |
| **Precision / stack** | bf16, 24×H200, DeepSpeed ZeRO-1, FlashAttention-2 |
|
| 78 |
| **Architecture class** | `Qwen3ForCausalLM` (stock, exports with no custom modelling code) |
|
| 79 |
|
|
@@ -434,19 +433,17 @@ tok = AutoTokenizer.from_pretrained(model_id)
|
|
| 434 |
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")
|
| 435 |
|
| 436 |
prompt = "IMPRESSION: The chest radiograph demonstrates"
|
| 437 |
-
ids = tok(prompt, return_tensors="pt").to(model.device)
|
| 438 |
out = model.generate(**ids, max_new_tokens=128, do_sample=False)
|
| 439 |
print(tok.decode(out[0], skip_special_tokens=True))
|
| 440 |
```
|
| 441 |
|
| 442 |
-
###
|
| 443 |
|
| 444 |
-
- **
|
| 445 |
-
|
| 446 |
-
- **`add_bos_token=False`.** Setting it true double-prepends BOS and breaks generation.
|
| 447 |
-
- **One special token.** `<|endoftext|>` (id 0) serves eos/bos/pad and the document separator.
|
| 448 |
- **Base model, no chat template.** It completes text. Prompt it as a completion model, or post-train it.
|
| 449 |
-
-
|
| 450 |
|
| 451 |
---
|
| 452 |
|
|
|
|
| 71 |
| **Training tokens** | **235.2B** (one complete epoch over a 54-source medical/biomedical corpus) |
|
| 72 |
| **Final train loss** | ≈1.16 |
|
| 73 |
| **Context** | trained at **24,576** tokens (whole-document); `max_position_embeddings` **32,768** |
|
| 74 |
+
| **RoPE** | standard 1D, **θ = 25,000** |
|
| 75 |
| **Tokenizer** | custom **32k byte-level BPE** ("v5-32k"), `add_bos_token=False`, single special token `<|endoftext|>` (id 0 = eos/bos/pad) |
|
|
|
|
| 76 |
| **Precision / stack** | bf16, 24×H200, DeepSpeed ZeRO-1, FlashAttention-2 |
|
| 77 |
| **Architecture class** | `Qwen3ForCausalLM` (stock, exports with no custom modelling code) |
|
| 78 |
|
|
|
|
| 433 |
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")
|
| 434 |
|
| 435 |
prompt = "IMPRESSION: The chest radiograph demonstrates"
|
| 436 |
+
ids = tok(prompt, return_tensors="pt").to(model.device)
|
| 437 |
out = model.generate(**ids, max_new_tokens=128, do_sample=False)
|
| 438 |
print(tok.decode(out[0], skip_special_tokens=True))
|
| 439 |
```
|
| 440 |
|
| 441 |
+
### Notes
|
| 442 |
|
| 443 |
+
- **Works with `transformers` 4.x and 5.x out of the box.** Verified on 4.57.1 and 5.2.0: the snippet
|
| 444 |
+
above runs unchanged on both.
|
|
|
|
|
|
|
| 445 |
- **Base model, no chat template.** It completes text. Prompt it as a completion model, or post-train it.
|
| 446 |
+
- **One special token.** `<|endoftext|>` (id 0) serves eos/bos/pad and the document separator.
|
| 447 |
|
| 448 |
---
|
| 449 |
|