Text2Text Generation
GGUF
English
medical
Inference Endpoints
mav23 commited on
Commit
20beb74
·
verified ·
1 Parent(s): 7e64f78

Upload folder using huggingface_hub

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +162 -0
  3. asclepius-llama2-7b.Q4_0.gguf +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* 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
 
 
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
36
+ asclepius-llama2-7b.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ datasets:
4
+ - starmpcc/Asclepius-Synthetic-Clinical-Notes
5
+ language:
6
+ - en
7
+ pipeline_tag: text2text-generation
8
+ tags:
9
+ - medical
10
+ ---
11
+ # Model Card for Model ID
12
+
13
+ <!-- Provide a quick summary of what the model is/does. -->
14
+
15
+ This is an official model checkpoint for Asclepius-Llama2-7B [(arxiv)](https://arxiv.org/abs/2309.00237).
16
+ This model is an enhanced version of Asclepius-7B, by replacing the base model with Llama-2 and increasing the max sequence length to 4096.
17
+
18
+ ## UPDATE
19
+ ### 2024.01.10
20
+ - Asclepius-R, the variant of Asclepius that trained on MIMIC-III discharge summaries, is now available on [Physionet](https://physionet.org/content/asclepius-r/1.0.0/)!
21
+
22
+ ## Model Details
23
+
24
+ ### Model Description
25
+
26
+ <!-- Provide a longer summary of what this model is. -->
27
+
28
+
29
+
30
+ - **Model type:** Clinical LLM (Large Language Model)
31
+ - **Language(s) (NLP):** English
32
+ - **License:** CC-BY-NC-SA 4.0
33
+ - **Finetuned from model [optional]:** Llama2-7B
34
+
35
+ ### Model Sources [optional]
36
+
37
+ <!-- Provide the basic links for the model. -->
38
+
39
+ - **Repository:** https://github.com/starmpcc/Asclepius
40
+ - **Paper:** https://arxiv.org/abs/2309.00237
41
+ - **Data:** https://huggingface.co/datasets/starmpcc/Asclepius-Synthetic-Clinical-Notes
42
+
43
+ ## Uses
44
+
45
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
46
+ This model can perform below 8 clinical NLP tasks, with clincal notes.
47
+ - Named Entity Recognition
48
+ - Abbreviation Expansion
49
+ - Relation Extraction
50
+ - Temporal Information Extraction
51
+ - Coreference Resolution
52
+ - Paraphrasing
53
+ - Summarization
54
+ - Question Answering
55
+
56
+ ### Direct Use
57
+
58
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
59
+
60
+ [More Information Needed]
61
+
62
+ ### Downstream Use [optional]
63
+
64
+ <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
65
+
66
+ [More Information Needed]
67
+
68
+ ### Out-of-Scope Use
69
+
70
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
71
+
72
+ ONLY USE THIS MODEL FOR RESEARCH PURPOSE!!
73
+
74
+ ## How to Get Started with the Model
75
+
76
+ ```python
77
+ prompt = """You are an intelligent clinical languge model.
78
+ Below is a snippet of patient's discharge summary and a following instruction from healthcare professional.
79
+ Write a response that appropriately completes the instruction.
80
+ The response should provide the accurate answer to the instruction, while being concise.
81
+
82
+ [Discharge Summary Begin]
83
+ {note}
84
+ [Discharge Summary End]
85
+
86
+ [Instruction Begin]
87
+ {question}
88
+ [Instruction End]
89
+ """
90
+
91
+ from transformers import AutoTokenizer, AutoModelForCausalLM
92
+ tokenizer = AutoTokenizer.from_pretrained("starmpcc/Asclepius-Llama2-7B", use_fast=False)
93
+ model = AutoModelForCausalLM.from_pretrained("starmpcc/Asclepius-Llama2-7B")
94
+
95
+ note = "This is a sample note"
96
+ question = "What is the diagnosis?"
97
+
98
+ model_input = prompt.format(note=note, question=question)
99
+ input_ids = tokenizer(model_input, return_tensors="pt").input_ids
100
+ output = model.generate(input_ids)
101
+ print(tokenizer.decode(output[0]))
102
+ ```
103
+
104
+ ## Training Details
105
+
106
+ ### Training Data
107
+
108
+ <!-- This should link to a Data Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
109
+
110
+ https://huggingface.co/datasets/starmpcc/Asclepius-Synthetic-Clinical-Notes
111
+
112
+ ### Training Procedure
113
+
114
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
115
+ - Initial training was conducted using causal language modeling on synthetic clinical notes.
116
+ - It was then fine-tuned with clinical instruction-response pairs.
117
+ - For a comprehensive overview of our methods, our upcoming paper will serve as a resource.
118
+
119
+ #### Training Hyperparameters
120
+
121
+ - We followed config used in [Stanford Alpaca](https://github.com/tatsu-lab/stanford_alpaca)
122
+ -
123
+ #### Speeds, Sizes, Times
124
+
125
+ <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
126
+ - Pre-Training (1 epoch): 1h 7m with 8x A100 80G
127
+ - Instruction Fine-Tuning (3 epoch): 6h 47m with 8x A100 80G
128
+
129
+
130
+
131
+ ## Citation
132
+
133
+ <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
134
+
135
+ **BibTeX:**
136
+
137
+ ```
138
+ @misc{kweon2023publicly,
139
+ title={Publicly Shareable Clinical Large Language Model Built on Synthetic Clinical Notes},
140
+ author={Sunjun Kweon and Junu Kim and Jiyoun Kim and Sujeong Im and Eunbyeol Cho and Seongsu Bae and Jungwoo Oh and Gyubok Lee and Jong Hak Moon and Seng Chan You and Seungjin Baek and Chang Hoon Han and Yoon Bin Jung and Yohan Jo and Edward Choi},
141
+ year={2023},
142
+ eprint={2309.00237},
143
+ archivePrefix={arXiv},
144
+ primaryClass={cs.CL}
145
+ }
146
+ ```
147
+
148
+
149
+
150
+ # [Open LLM Leaderboard Evaluation Results](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard)
151
+ Detailed results can be found [here](https://huggingface.co/datasets/open-llm-leaderboard/details_starmpcc__Asclepius-Llama2-7B)
152
+
153
+ | Metric | Value |
154
+ |-----------------------|---------------------------|
155
+ | Avg. | 42.38 |
156
+ | ARC (25-shot) | 50.85 |
157
+ | HellaSwag (10-shot) | 76.53 |
158
+ | MMLU (5-shot) | 43.61 |
159
+ | TruthfulQA (0-shot) | 43.31 |
160
+ | Winogrande (5-shot) | 68.27 |
161
+ | GSM8K (5-shot) | 0.3 |
162
+ | DROP (3-shot) | 13.8 |
asclepius-llama2-7b.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34bc8f87c7b55435dcabe19e97a196d104c8529bbb1552f565688e67d3b0bd3e
3
+ size 3825807616