Upload folder using huggingface_hub
Browse files- README.md +5 -5
- config.json +9 -1
- generation_config.json +1 -1
- model.safetensors +2 -2
- pytorch_model.bin +3 -0
README.md
CHANGED
@@ -17,7 +17,7 @@ extra_gated_fields:
|
|
17 |
|
18 |
# gpt-base-2048-clmbr
|
19 |
|
20 |
-
This is a **gpt** model with context length **2048** from the [Context Clues paper](TODO).
|
21 |
|
22 |
It is a foundation model trained from scratch on the structured data within 2.57 million deidentified EHRs from Stanford Medicine.
|
23 |
|
@@ -30,7 +30,7 @@ First, install the `hf_ehr` package:
|
|
30 |
pip install transformers torch hf_ehr
|
31 |
```
|
32 |
|
33 |
-
Second, run this Python script
|
34 |
|
35 |
```python
|
36 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
@@ -102,7 +102,7 @@ This model is for research purposes only. It is not for use in any real-world de
|
|
102 |
|
103 |
## Bias, Risks, and Limitations
|
104 |
|
105 |
-
This model was trained on a corpus of 2.57 million patients from Stanford Medicine.
|
106 |
The model will thus reflect the patterns of how care is delivered at Stanford Medicine, in addition to the racial and socioeconomic makeup of Stanford Medicine's patient base.
|
107 |
This model may not generalize well to other hospitals and demographic mixes.
|
108 |
|
@@ -115,8 +115,8 @@ Full training details are provided in our accompanying paper, [TODO]
|
|
115 |
|
116 |
### Training Data
|
117 |
|
118 |
-
The model is trained on 2.57 million patients from the [Stanford Medicine Research Data Repository (STARR)](https://academic.oup.com/jamiaopen/article/6/3/ooad054/7236015),
|
119 |
-
which contains EHR data from both Stanford Health Care (primarily adult care) and Lucile Packard Children’s Hospital (primarily pediatric care).
|
120 |
The dataset contains only structured data (i.e. no clinical text or images) and covers demographics (e.g. age, sex, race), diagnoses, procedures, laboratory results, medication prescriptions, and other coded clinical observations.
|
121 |
The data is formatted according to the [Observational Medical Outcomes Partnership Common Data Model (OMOP-CDM)](https://ohdsi.github.io/CommonDataModel/cdm53.html).
|
122 |
All data that we work with is deidentified.
|
|
|
17 |
|
18 |
# gpt-base-2048-clmbr
|
19 |
|
20 |
+
This is a **gpt** model with context length **2048** with **117209088** parameters from the [Context Clues paper](TODO).
|
21 |
|
22 |
It is a foundation model trained from scratch on the structured data within 2.57 million deidentified EHRs from Stanford Medicine.
|
23 |
|
|
|
30 |
pip install transformers torch hf_ehr
|
31 |
```
|
32 |
|
33 |
+
Second, run this Python script to do inference on a patient representation:
|
34 |
|
35 |
```python
|
36 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
102 |
|
103 |
## Bias, Risks, and Limitations
|
104 |
|
105 |
+
This model was trained on a corpus of 2 billion tokens sourced from 2.57 million patients from Stanford Medicine.
|
106 |
The model will thus reflect the patterns of how care is delivered at Stanford Medicine, in addition to the racial and socioeconomic makeup of Stanford Medicine's patient base.
|
107 |
This model may not generalize well to other hospitals and demographic mixes.
|
108 |
|
|
|
115 |
|
116 |
### Training Data
|
117 |
|
118 |
+
The model is trained on 2 billion tokens sourced from 2.57 million patients from the [Stanford Medicine Research Data Repository (STARR)](https://academic.oup.com/jamiaopen/article/6/3/ooad054/7236015),
|
119 |
+
which contains structured EHR data from both Stanford Health Care (primarily adult care) and Lucile Packard Children’s Hospital (primarily pediatric care).
|
120 |
The dataset contains only structured data (i.e. no clinical text or images) and covers demographics (e.g. age, sex, race), diagnoses, procedures, laboratory results, medication prescriptions, and other coded clinical observations.
|
121 |
The data is formatted according to the [Observational Medical Outcomes Partnership Common Data Model (OMOP-CDM)](https://ohdsi.github.io/CommonDataModel/cdm53.html).
|
122 |
All data that we work with is deidentified.
|
config.json
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
{
|
|
|
2 |
"activation_function": "gelu_new",
|
3 |
"architectures": [
|
4 |
"GPT2LMHeadModel"
|
@@ -12,6 +13,7 @@
|
|
12 |
"layer_norm_epsilon": 1e-05,
|
13 |
"mask_token_id": 6,
|
14 |
"model_type": "gpt2",
|
|
|
15 |
"n_embd": 768,
|
16 |
"n_head": 12,
|
17 |
"n_inner": null,
|
@@ -28,8 +30,14 @@
|
|
28 |
"summary_proj_to_labels": true,
|
29 |
"summary_type": "cls_index",
|
30 |
"summary_use_proj": true,
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
"torch_dtype": "float32",
|
32 |
-
"transformers_version": "4.
|
33 |
"unk_token_id": 2,
|
34 |
"use_cache": true,
|
35 |
"vocab_size": 39818
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "gpt2",
|
3 |
"activation_function": "gelu_new",
|
4 |
"architectures": [
|
5 |
"GPT2LMHeadModel"
|
|
|
13 |
"layer_norm_epsilon": 1e-05,
|
14 |
"mask_token_id": 6,
|
15 |
"model_type": "gpt2",
|
16 |
+
"n_ctx": 1024,
|
17 |
"n_embd": 768,
|
18 |
"n_head": 12,
|
19 |
"n_inner": null,
|
|
|
30 |
"summary_proj_to_labels": true,
|
31 |
"summary_type": "cls_index",
|
32 |
"summary_use_proj": true,
|
33 |
+
"task_specific_params": {
|
34 |
+
"text-generation": {
|
35 |
+
"do_sample": true,
|
36 |
+
"max_length": 50
|
37 |
+
}
|
38 |
+
},
|
39 |
"torch_dtype": "float32",
|
40 |
+
"transformers_version": "4.44.2",
|
41 |
"unk_token_id": 2,
|
42 |
"use_cache": true,
|
43 |
"vocab_size": 39818
|
generation_config.json
CHANGED
@@ -3,5 +3,5 @@
|
|
3 |
"bos_token_id": 0,
|
4 |
"eos_token_id": 1,
|
5 |
"pad_token_id": 4,
|
6 |
-
"transformers_version": "4.
|
7 |
}
|
|
|
3 |
"bos_token_id": 0,
|
4 |
"eos_token_id": 1,
|
5 |
"pad_token_id": 4,
|
6 |
+
"transformers_version": "4.44.2"
|
7 |
}
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f1341db1fdf82e548b8ff869e7e7a5e283079c9baa52e84feb72ba6cc1e1530b
|
3 |
+
size 464132736
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f4a8d47e917919a351bf5b441dad553945b7b3a32596ff44bc35f5fe74ec7222
|
3 |
+
size 468882714
|