Commit ·
a55bc9d
0
Parent(s):
Duplicate from koyelog/MediMind-411M
Browse files- .gitattributes +35 -0
- README.md +129 -0
- checkpoint_latest.pt +3 -0
- medimind_final.pt +3 -0
- merges.txt +0 -0
- vocab.json +0 -0
.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: mit
|
| 5 |
+
tags:
|
| 6 |
+
- medical
|
| 7 |
+
- llm
|
| 8 |
+
- pytorch
|
| 9 |
+
- text-generation
|
| 10 |
+
- custom-model
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
+
library_name: pytorch
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# MediMind-411M
|
| 16 |
+
|
| 17 |
+
MediMind-411M is a custom medical language model trained from scratch for biomedical and clinical text generation.
|
| 18 |
+
|
| 19 |
+
This model was trained and uploaded by **Koyeliya Ghosh** under the Hugging Face account `koyelog`.
|
| 20 |
+
|
| 21 |
+
## Overview
|
| 22 |
+
|
| 23 |
+
MediMind-411M is a 411M-parameter transformer-based language model designed to generate medical-style text.
|
| 24 |
+
It was trained on a large medical text collection and uses a custom tokenizer.
|
| 25 |
+
|
| 26 |
+
## Training Summary
|
| 27 |
+
|
| 28 |
+
- Model name: `MediMind-411M`
|
| 29 |
+
- Parameters: approximately 411.1M
|
| 30 |
+
- Training device: Kaggle GPU T4 x2
|
| 31 |
+
- Total texts loaded: 171,047
|
| 32 |
+
- Training samples tokenized: 50,000
|
| 33 |
+
- Total batches: 12,500
|
| 34 |
+
- Final average loss: 4.9253
|
| 35 |
+
- Total runtime: about 5536.5 seconds (~92 minutes)
|
| 36 |
+
|
| 37 |
+
## Architecture
|
| 38 |
+
|
| 39 |
+
This model uses a decoder-only transformer architecture with:
|
| 40 |
+
|
| 41 |
+
- Embedding dimension: 1024
|
| 42 |
+
- Layers: 24
|
| 43 |
+
- Attention heads: 16
|
| 44 |
+
- KV heads: 8
|
| 45 |
+
- RoPE positional encoding
|
| 46 |
+
- RMSNorm
|
| 47 |
+
- SwiGLU-style feed-forward layers
|
| 48 |
+
|
| 49 |
+
## Files in this Repository
|
| 50 |
+
|
| 51 |
+
- `medimind_final.pt` — final trained model weights
|
| 52 |
+
- `checkpoint_latest.pt` — latest training checkpoint
|
| 53 |
+
- `vocab.json` — tokenizer vocabulary
|
| 54 |
+
- `merges.txt` — tokenizer merges
|
| 55 |
+
|
| 56 |
+
## Testing
|
| 57 |
+
|
| 58 |
+
The model was tested locally in a Kaggle notebook by:
|
| 59 |
+
|
| 60 |
+
1. Downloading the model files from this Hugging Face repository
|
| 61 |
+
2. Loading the tokenizer using `vocab.json` and `merges.txt`
|
| 62 |
+
3. Rebuilding the training architecture in PyTorch
|
| 63 |
+
4. Loading `medimind_final.pt`
|
| 64 |
+
5. Generating outputs from medical prompts
|
| 65 |
+
|
| 66 |
+
### Example test prompts
|
| 67 |
+
|
| 68 |
+
- `Patient presents with fever and cough. Diagnosis:`
|
| 69 |
+
- `Symptoms of diabetes include`
|
| 70 |
+
- `Treatment for hypertension includes`
|
| 71 |
+
|
| 72 |
+
### Observed behavior
|
| 73 |
+
|
| 74 |
+
The model successfully generates medical-style text and terminology.
|
| 75 |
+
Outputs show that the model has learned domain vocabulary and sentence patterns, but generations can still be noisy, mixed-topic, or clinically unreliable.
|
| 76 |
+
|
| 77 |
+
## Limitations
|
| 78 |
+
|
| 79 |
+
- This is an early-stage base language model, not an instruction-tuned chatbot.
|
| 80 |
+
- It may produce incorrect, incomplete, or hallucinated medical statements.
|
| 81 |
+
- It should **not** be used for real medical diagnosis, treatment, or decision-making.
|
| 82 |
+
- Output quality can vary depending on prompt style and decoding settings.
|
| 83 |
+
|
| 84 |
+
## Intended Use
|
| 85 |
+
|
| 86 |
+
This model is intended for:
|
| 87 |
+
|
| 88 |
+
- learning and experimentation
|
| 89 |
+
- research practice
|
| 90 |
+
- testing custom LLM training pipelines
|
| 91 |
+
- educational exploration of medical text generation
|
| 92 |
+
|
| 93 |
+
This model is **not intended** for direct clinical deployment or patient-facing use.
|
| 94 |
+
|
| 95 |
+
## Example Usage
|
| 96 |
+
|
| 97 |
+
```python
|
| 98 |
+
from huggingface_hub import hf_hub_download
|
| 99 |
+
from tokenizers import ByteLevelBPETokenizer
|
| 100 |
+
import torch
|
| 101 |
+
|
| 102 |
+
model_path = hf_hub_download(repo_id="koyelog/MediMind-411M", filename="medimind_final.pt")
|
| 103 |
+
vocab_path = hf_hub_download(repo_id="koyelog/MediMind-411M", filename="vocab.json")
|
| 104 |
+
merges_path = hf_hub_download(repo_id="koyelog/MediMind-411M", filename="merges.txt")
|
| 105 |
+
|
| 106 |
+
tokenizer = ByteLevelBPETokenizer(vocab_path, merges_path)
|
| 107 |
+
|
| 108 |
+
print("Load tokenizer and model architecture, then run generation.")
|
| 109 |
+
```
|
| 110 |
+
|
| 111 |
+
## Future Work
|
| 112 |
+
|
| 113 |
+
Planned next improvements:
|
| 114 |
+
|
| 115 |
+
- cleaner inference pipeline
|
| 116 |
+
- better decoding and stopping rules
|
| 117 |
+
- further training epochs
|
| 118 |
+
- instruction tuning on medical QA data
|
| 119 |
+
- model card improvements and benchmark evaluation
|
| 120 |
+
|
| 121 |
+
## Author
|
| 122 |
+
|
| 123 |
+
Created by **Koyeliya Ghosh**
|
| 124 |
+
Hugging Face: [koyelog](https://huggingface.co/koyelog)
|
| 125 |
+
|
| 126 |
+
## Disclaimer
|
| 127 |
+
|
| 128 |
+
This model is for research and educational purposes only.
|
| 129 |
+
It must not be used as a substitute for licensed medical advice or professional healthcare judgment.
|
checkpoint_latest.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8c657060025a16ecedb618dd31423ae182725e6cd0b1001212771d10071bad17
|
| 3 |
+
size 4958564991
|
medimind_final.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bc9466f36b1bfc1a26e9b2a475a30ab3ef34f870397d5cebe6b50842dcf1d92b
|
| 3 |
+
size 1669635739
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|