mav23 commited on
Commit
c9b7436
·
verified ·
1 Parent(s): 3c08505

Upload folder using huggingface_hub

Browse files
.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
+ open_llama_7b_v2_med_instruct.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ datasets:
4
+ - ehartford/dolphin
5
+ - LinhDuong/chatdoctor-200k
6
+ - sahil2801/code_instructions_120k
7
+ - medalpaca/medical_meadow_mediqa
8
+ - kaiokendev/SuperCOT-dataset
9
+ - tiiuae/falcon-refinedweb
10
+ - bigcode/starcoderdata
11
+ - togethercomputer/RedPajama-Data-1T
12
+ language:
13
+ - en
14
+ library_name: transformers
15
+ pipeline_tag: text-generation
16
+ tags:
17
+ - medical
18
+ - code
19
+ ---
20
+ # Model Card for Model ID
21
+
22
+ <!-- Provide a quick summary of what the model is/does. -->
23
+
24
+ This model is an instruction-tuned Open LLaMa model with 7B parameters, with specialities in medical QA and code instruction.
25
+
26
+ ## Model Details
27
+
28
+ <!-- Provide a longer summary of what this model is. -->
29
+
30
+ - **Model type:** LlamaForCausalLM
31
+ - **Language(s) (NLP):** English
32
+ - **License:** Apache 2.0
33
+ - **Finetuned from model (QLoRA):** [openlm-research/open_llama_7b_v2](https://huggingface.co/openlm-research/open_llama_7b_v2)
34
+
35
+ ## How to Get Started with the Model
36
+
37
+ Use the code below to get started with the model.
38
+
39
+ ```py
40
+ import torch
41
+ from transformers import LlamaTokenizer, LlamaForCausalLM
42
+
43
+ model_path = 'yhyhy3/open_llama_7b_v2_med_dolphin_qlora_merged'
44
+
45
+ tokenizer = LlamaTokenizer.from_pretrained(model_path)
46
+ model = LlamaForCausalLM.from_pretrained(
47
+ model_path, torch_dtype=torch.float16, device_map='auto',
48
+ )
49
+
50
+ prompt = '''### Instruction: Answer the following question.
51
+
52
+ ### Input: What is the capital of New Jersey?
53
+
54
+ ### Response:'''
55
+ input_ids = tokenizer(prompt, return_tensors="pt").input_ids
56
+
57
+ generation_output = model.generate(
58
+ input_ids=input_ids, max_new_tokens=32
59
+ )
60
+ print(tokenizer.decode(generation_output[0]))
61
+ ```
62
+
63
+ ## Training Details
64
+
65
+ ### Training Data
66
+
67
+ Converted the following datasets to alpaca:instruction format.
68
+
69
+ 1. [ehartford/dolphin](https://huggingface.co/datasets/ehartford/dolphin)
70
+ - ORCA style dataset generously created by [Eric Hartford](https://huggingface.co/ehartford)
71
+ - Only used the 1 million GPT4 generated instructions file [flan1m-alpaca-uncensored.jsonl](https://huggingface.co/datasets/ehartford/dolphin/blob/main/flan1m-alpaca-uncensored.jsonl).
72
+ 2. [LinhDuong/chatdoctor-200k](https://huggingface.co/datasets/LinhDuong/chatdoctor-200k)
73
+ - Refined dataset sourced from icliniq medical QA forum
74
+ 3. [sahil2801/code_instructions_120k](https://huggingface.co/datasets/sahil2801/code_instructions_120k)
75
+ - Code instruction dataset generously created by Sahil Chaudhary from ThreeSixty AI
76
+ 4. [medalpaca/medical_meadow_mediqa](https://huggingface.co/datasets/medalpaca/medical_meadow_mediqa)
77
+ - MEDIQA is a dataset of manually generated, question-driven summaries of multi and single document answers to consumer health questions from medalpaca group.
78
+ 5. [kaiokendev/SuperCOT-dataset](https://huggingface.co/datasets/kaiokendev/SuperCOT-dataset)
79
+ - Code instruction dataset generously created by Kaio Ken
80
+
81
+ ### Training Procedure
82
+
83
+ Trained using [axolotl](https://github.com/OpenAccess-AI-Collective/axolotl) QLoRa on [RunPod](https://www.runpod.io/console/gpu-cloud) 8x A6000 on Community Cloud for 3 epochs (~14 hours - ~$70).
84
+
85
+ <details>
86
+ <summary>axolotl training config:</summary>
87
+
88
+ ```yaml
89
+ base_model: openlm-research/open_llama_7b_v2
90
+ base_model_config: openlm-research/open_llama_7b_v2
91
+ model_type: LlamaForCausalLM
92
+ tokenizer_type: LlamaTokenizer
93
+ load_in_8bit: false
94
+ load_in_4bit: true
95
+ strict: false
96
+
97
+ push_dataset_to_hub:
98
+ hub_model_id:
99
+ hf_use_auth_token:
100
+
101
+ datasets:
102
+ - path: json
103
+ type: alpaca
104
+ data_files: /disk/flan1m-alpaca-uncensored.jsonl
105
+ shards: 8
106
+ - path: sahil2801/code_instructions_120k
107
+ type: alpaca
108
+ - path: LinhDuong/chatdoctor-200k
109
+ type: alpaca
110
+ shards: 2
111
+ - path: kaiokendev/SuperCOT-dataset
112
+ type: alpaca
113
+ - path: medalpaca/medical_meadow_mediqa
114
+ type: alpaca
115
+
116
+ dataset_prepared_path: last_run_prepared
117
+ val_set_size: 0.01
118
+ adapter: qlora
119
+ lora_model_dir:
120
+ sequence_len: 2048
121
+ max_packed_sequence_len: 2048
122
+ lora_r: 8
123
+ lora_alpha: 32
124
+ lora_dropout: 0.05
125
+ lora_target_modules:
126
+ lora_target_linear: true
127
+ lora_fan_in_fan_out:
128
+
129
+ wandb_mode: true
130
+ wandb_project:
131
+ wandb_watch:
132
+ wandb_run_id:
133
+ wandb_log_model: 'openllama_checkpoint'
134
+ output_dir: /disk/open_llama_7b_v2_dolphin_qlora
135
+ gradient_accumulation_steps: 2
136
+ micro_batch_size: 16
137
+ num_epochs: 3
138
+ optimizer: paged_adamw_32bit
139
+ torchdistx_path:
140
+ lr_scheduler: cosine
141
+ learning_rate: 0.0002
142
+ train_on_inputs: false
143
+ group_by_length: false
144
+ bf16: true
145
+ fp16: false
146
+ tf32: true
147
+ gradient_checkpointing: true
148
+ early_stopping_patience:
149
+ resume_from_checkpoint:
150
+ local_rank:
151
+ logging_steps: 1
152
+ xformers_attention: true
153
+ flash_attention:
154
+ gptq_groupsize:
155
+ gptq_model_v1:
156
+ warmup_steps: 1000
157
+ eval_steps: 5000
158
+ save_steps:
159
+ debug:
160
+ deepspeed:
161
+ weight_decay: 0.0000001
162
+ fsdp:
163
+ fsdp_config:
164
+ special_tokens:
165
+ bos_token: "<s>"
166
+ eos_token: "</s>"
167
+ unk_token: "<unk>"
168
+ ```
169
+ </details>
open_llama_7b_v2_med_instruct.Q4_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ddc2d42ea381d14ace04d212741845404f0430cd1077f90903a52089a137533
3
+ size 3825819648