Instructions to use Opflare1144/groundnote-239m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Opflare1144/groundnote-239m with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Opflare1144/groundnote-239m")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Opflare1144/groundnote-239m") model = AutoModelForCausalLM.from_pretrained("Opflare1144/groundnote-239m", device_map="auto") - Transformers.js
How to use Opflare1144/groundnote-239m with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'Opflare1144/groundnote-239m'); - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Opflare1144/groundnote-239m with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Opflare1144/groundnote-239m" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Opflare1144/groundnote-239m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Opflare1144/groundnote-239m
- SGLang
How to use Opflare1144/groundnote-239m 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 "Opflare1144/groundnote-239m" \ --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": "Opflare1144/groundnote-239m", "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 "Opflare1144/groundnote-239m" \ --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": "Opflare1144/groundnote-239m", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Opflare1144/groundnote-239m with Docker Model Runner:
docker model run hf.co/Opflare1144/groundnote-239m
groundnote-239m
A 239M-parameter Llama-style decoder that turns a doctor–patient conversation into a sectioned clinical note: Chief Complaint, HPI, Past Medical History, Allergies, Physical Exam, Assessment, Plan.
Intended use
Research and education on clinical-note generation and on checking notes against their transcripts.
Out of scope
- Any clinical use: diagnosis, treatment, documentation of real care, or decision support.
- Real patient data. Do not feed it transcripts of real patients.
Architecture:
- 16 layers, d=1024, 32k byte-level BPE vocabulary, 3,072-token context.
- The tokenizer and the weights were both trained from scratch, with no pretrained checkpoint. The tokenizer was trained on about 300 MB of FineWeb-Edu plus the fine-tuning train set.
Pretraining: 3.0B tokens of FineWeb-Edu
sample/10BT, shards 000–003 (ODC-By 1.0), one epoch. That took
13.3 GPU-hours, mostly on H100.
Fine-tuning (28,454 examples, 4 epochs, best dev loss at epoch 3):
- about 18k synthetic encounters written by Gemma 4 31B (Apache-2.0 per its model card);
- ACI-Bench train notes, oversampled (ACI-Bench, Yim et al., 2023, CC BY 4.0);
- MTS-Dialog train sections plus its back-translated augmentation (MTS-Dialog, Ben Abacha et al., 2023, CC BY 4.0).
"About 18k synthetic": about 20k encounters were generated, 5% were held out as dev/test, and notes with two or more contradicted clauses were dropped from train.
The weights are released under CC BY 4.0.
Use it with the groundnote code
The code forces the section headers and checks each clause against the transcript:
git clone https://github.com/hxlvvm/groundnote && cd groundnote
pip install torch==2.13.0 transformers==5.17.0
python -m groundnote.app Opflare1144/groundnote-239m # web page at http://localhost:8000
In the browser
onnx/model_f16w.onnx runs the model in a web page with transformers.js
(live demo: https://groundnote.vercel.app/demo.html).
- The weights are stored as fp16 and cast back to fp32 when the session starts, so it is a 480 MB download that computes in full precision.
- On three example visits its notes match the PyTorch model word for word.
- Scored with the same script on the gate test sets: ACI-Bench test1 ROUGE-1 48.3, unsupported 73.1%; synthetic denied facts written as present 3.2%.
const model = await AutoModelForCausalLM.from_pretrained("Opflare1144/groundnote-239m", { dtype: "fp32", model_file_name: "model_f16w" });
The section-by-section decoding loop is docs/note.js in the GitHub repo.
Results
Greedy decoding on held-out test splits, compared with the earlier 97.5M model, which was trained without pretraining:
| Test set | 239M | 97.5M |
|---|---|---|
| ACI-Bench test1 (40 real visits): ROUGE-1 | 48.4 | 44.0 |
| ACI-Bench test1: clauses not found in transcript (gold note 37%) | 71% | 84% |
| Synthetic (200): denied facts written as present | 3.2% | 7.6% |
| Synthetic: fact recall | 83.5% | 60.4% |
The repo's GATE.md fixed these comparisons before the 239M model was trained.
Limits
- It still hallucinates on real conversations. 71% of its clauses on real visits cannot be found in the transcript, against 37% for doctors' notes. Most of the gap is domain shift: 63% of the fine-tuning examples are synthetic.
- Use it with the clause checker, and read every note against its transcript.
- Research prototype. Not for clinical use. Not a medical device.
- Downloads last month
- 29