CoolFace
Modelpublic

QueryloopAI/gemma-2b-openhermes

sourceHugging Facecc-by-nc-4.0updated 3y agoView on Hugging Face
0likes123downloads
README.md283 linesDownload Raw Back to root
1---2license: cc-by-nc-4.03base_model: google/gemma-2b-it4tags:5- generated_from_trainer6- axolotl7- gemma8- instruct9- finetune10- chatml11- gpt412- synthetic data13- distillation14model-index:15- name: gemma-2b-openhermes16  results: []17datasets:18- mlabonne/chatml-OpenHermes2.5-dpo-binarized-alpha19language:20- en21library_name: transformers22pipeline_tag: text-generation23---24<!-- This model card has been generated automatically according to the information the Trainer had access to. You25should probably proofread and complete it, then remove this comment. -->26 27# gemma-2b-openhermes28 29 30![image/jpeg](https://cdn-uploads.huggingface.co/production/uploads/64e380b2e12618b261fa6ba0/9bmxL8Lt7hBaKlKHVxtew.jpeg)31 32gemma-2b-openhermes is a variant of the Gemma 2B language model, which has been further fine-tuned on the OpenHermes-2.5 preference dataset 33using QLoRA.34 35 36* [google/gemma-2b-it](https://huggingface.co/google/gemma-2b-it)37* [mlabonne/chatml-OpenHermes2.5-dpo-binarized-alpha](https://huggingface.co/datasets/mlabonne/chatml-OpenHermes2.5-dpo-binarized-alpha)38 39</details><br>40 41## Usage42 43### Chat Template44 45The instruction-tuned models use a chat template that must be adhered to for conversational use.46The easiest way to apply it is using the tokenizer's built-in chat template, as shown in the following snippet.47 48Let's load the model and apply the chat template to a conversation. In this example, we'll start with a single user interaction:49 50```py51from transformers import AutoTokenizer, AutoModelForCausalLM52import transformers53import torch54 55model_id = "abideen/gemma-2b-openhermes"56dtype = torch.bfloat1657 58tokenizer = AutoTokenizer.from_pretrained(model_id)59model = AutoModelForCausalLM.from_pretrained(60    model_id,61    device_map="cuda",62    torch_dtype=dtype,63)64 65chat = [{ "role": "user", "content": "What is a Language Model?" }]66prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)67```68 69After the prompt is ready, generation can be performed like this:70 71```py72inputs = tokenizer.encode(prompt, add_special_tokens=True, return_tensors="pt")73outputs = model.generate(input_ids=inputs.to(model.device), max_new_tokens=250)74print(tokenizer.decode(outputs[0]))75```76 77### Inputs and outputs78 79*   **Input:** Text string, such as a question, a prompt, or a document to be80    summarized.81*   **Output:** Generated English-language text in response to the input, such82    as an answer to a question, or a summary of a document.83 84## 🏆 Evaluation results85 86# Nous Benchmark87 88Agieval89 90| Task                                      | Version | Metric | Value |   | StdErr |91|-------------------------------------------|---------|--------|-------|---|---------|92| agieval\_aqua\_rat                        | 0       | acc    | 24.02 | _ | 2.69    |93| agieval\_aqua\_rat                        | 0       | acc\_norm | 24.02 | _ | 2.69    |94| agieval\_logiqa\_en                      | 0       | acc    | 23.20 | _ | 1.66    |95| agieval\_logiqa\_en                      | 0       | acc\_norm | 24.42 | _ | 1.69    |96| agieval\_lsat\_ar                        | 0       | acc    | 18.26 | _ | 2.55    |97| agieval\_lsat\_ar                        | 0       | acc\_norm | 18.70 | _ | 2.58    |98| agieval\_lsat\_lr                        | 0       | acc    | 22.35 | _ | 1.85    |99| agieval\_lsat\_lr                        | 0       | acc\_norm | 23.53 | _ | 1.88    |100| agieval\_lsat\_rc                        | 0       | acc    | 20.82 | _ | 2.48    |101| agieval\_lsat\_rc                        | 0       | acc\_norm | 20.07 | _ | 2.45    |102| agieval\_sat\_en                         | 0       | acc    | 32.52 | _ | 3.27    |103| agieval\_sat\_en                         | 0       | acc\_norm | 32.52 | _ | 3.27    |104| agieval\_sat\_en\_without\_passage       | 0       | acc    | 25.73 | _ | 3.05    |105| agieval\_sat\_en\_without\_passage       | 0       | acc\_norm | 24.27 | _ | 2.99    |106| agieval\_sat\_math                        | 0       | acc    | 25.00 | _ | 2.93    |107| agieval\_sat\_math                        | 0       | acc\_norm | 20.91 | _ | 2.75    |108Average: 24.11109 110GPT4ALL111 112| Task                 | Version | Metric | Value |   | StdErr |113|----------------------|---------|--------|-------|---|---------|114| arc\_challenge       | 0       | acc    | 21.77 | _ | 1.21    |115| arc\_challenge       | 0       | acc\_norm | 24.15 | _ | 1.25    |116| arc\_easy            | 0       | acc    | 37.37 | _ | 0.99    |117| arc\_easy            | 0       | acc\_norm | 36.95 | _ | 0.99    |118| boolq               | 1       | acc    | 65.60 | _ | 0.83    |119| hellaswag           | 0       | acc    | 34.54 | _ | 0.47    |120| hellaswag           | 0       | acc\_norm | 40.54 | _ | 0.49    |121| openbookqa          | 0       | acc    | 15.00 | _ | 1.59    |122| openbookqa          | 0       | acc\_norm | 27.40 | _ | 2.00    |123| piqa                | 0       | acc    | 60.88 | _ | 1.14    |124| piqa                | 0       | acc\_norm | 60.55 | _ | 1.14    |125| winogrande          | 0       | acc    | 50.91 | _ | 1.41    |126Average: 40.01127 128BigBench129 130| Task                              | Version | Metric | Value  | Std Err |131|-----------------------------------|---------|--------|--------|---------|132| bigbench\_causal\_judgement        | 0       | MCG    | 50     | 2.26   |133| bigbench\_date\_understanding       | 0       | MCG    | 49.14  | 2.18   |134| bigbench\_disambiguation\_qa        | 0       | MCG    | 49.31  | 2.74   |135| bigbench\_geometric\_shapes         | 0       | MCG    | 14.18  | 1.37   |136| bigbench\_logical\_deduction\_5objs | 0       | MCG    | 49.41  | 2.73   |137| bigbench\_logical\_deduction\_7objs | 0       | MCG    | 41.48  | 2.46   |138| bigbench\_logical\_deduction\_3objs | 0       | MCG    | 69.33  | 2.75   |139| bigbench\_movie\_recommendation     | 0       | MCG    | 51.71  | 2.25   |140| bigbench\_navigate                 | 0       | MCG    | 50     | 1.58   |141| bigbench\_reasoning\_colored\_obj   | 0       | MCG    | 51.92  | 0.99   |142| bigbench\_ruin\_names               | 0       | MCG    | 48.14  | 2.01   |143| bigbench\_salient\_trans\_err\_detec | 0       | MCG    | 39.92  | 1.2    |144| bigbench\_snarks                   | 0       | MCG    | 64.14  | 3.71   |145| bigbench\_sports\_understanding     | 0       | MCG    | 55.31  | 1.59   |146| bigbench\_temporal\_sequences       | 0       | MCG    | 46.92  | 1.4    |147| bigbench\_tsk\_shuff\_objs\_5       | 0       | MCG    | 25.04  | 1.01   |148| bigbench\_tsk\_shuff\_objs\_7       | 0       | MCG    | 15.04  | 0.72   |149| bigbench\_tsk\_shuff\_objs\_3       | 0       | MCG    | 55.33  | 2.75   |150Average: 44.75151 152TruthfulQA153 154| Task                             | Version | Metric | Value | Std Err |155|----------------------------------|---------|--------|--------|----------|156| truthfulqa\_mc                   | 1       | mc1    | 30.11  | 1.61    |157| truthfulqa\_mc                   | 1       | mc2    | 47.69  | 1.61    |158Average: 38.90159 160 161# Openllm Benchmark162 163|    Task     |Version| Metric |Value|   |Stderr|164|-------------|------:|--------|----:|---|-----:|165|arc_challenge|      0|acc     |40.44|±  |  1.43|166|             |       |acc_norm|43.81|±  |  1.34|167|hellaswag    |      0|acc     |48.1 |±  |  0.45|168|             |       |acc_norm|62.73|±  |  0.32|169|gsm8k        |      0|acc     |5.6  |±  |  0.6 |170|winogrande   |      0|acc     |60.91|±  |  1.3 |171|mmlu         |      0|acc     |37.62  |±|  0.6 |172 173Average: 73.5%174 175### TruthfulQA176|    Task     |Version|Metric|Value|   |Stderr|177|-------------|------:|------|----:|---|-----:|178|truthfulqa_mc|      1|mc1   |29.00|±  |  1.58|179|             |       |mc2   |45.83|±  |  1.59|180 181 182### Training hyperparameters183 184The following hyperparameters were used during training:185- learning_rate: 5e-07186- train_batch_size: 1187- eval_batch_size: 8188- seed: 42189- gradient_accumulation_steps: 8190- total_train_batch_size: 8191- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08192- lr_scheduler_type: cosine193- lr_scheduler_warmup_steps: 100194- training_steps: 1300195 196 197### 📝 Axolotl Configuration198 199```yaml200base_model: google/gemma-2b-it201model_type: GemmaForCausalLM202tokenizer_type: GemmaTokenizer203trust_remote_code: true204 205load_in_8bit: false206load_in_4bit: true207strict: false208 209rl: dpo210chat_template: chatml211datasets:212  - path: mlabonne/chatml-OpenHermes2.5-dpo-binarized-alpha213    split: train214    type: chatml.intel215dataset_prepared_path:216val_set_size: 0.01217output_dir: ./out218 219adapter: qlora220lora_model_dir:221 222sequence_len: 1800223sample_packing: false224pad_to_sequence_len: false225 226lora_r: 16227lora_alpha: 16228lora_dropout: 0.05229lora_target_linear: true230lora_fan_in_fan_out:231lora_target_modules:232 233wandb_project: gemma234wandb_entity:235wandb_watch:236wandb_name:237wandb_log_model:238 239gradient_accumulation_steps: 8240micro_batch_size: 1241num_epochs: 1242optimizer: paged_adamw_32bit243lr_scheduler: cosine244learning_rate: 5e-7245 246train_on_inputs: false247group_by_length: false248bf16: true249fp16: false250tf32: true251 252gradient_checkpointing: true253early_stopping_patience:254resume_from_checkpoint:255local_rank:256logging_steps: 1257xformers_attention:258flash_attention: false259 260warmup_steps: 100261evals_per_epoch: 1262eval_table_size:263eval_table_max_new_tokens: 128264save_steps: 1000265max_steps: 1300266debug:267deepspeed:268weight_decay: 0.0269fsdp:270fsdp_config:271special_tokens:272```273 274 275### Framework versions276 277- Transformers 4.39.0.dev0278- Pytorch 2.1.2+cu118279- Datasets 2.17.0280- Tokenizers 0.15.0281- axolotl: 0.4.0282 283[<img src="https://raw.githubusercontent.com/OpenAccess-AI-Collective/axolotl/main/image/axolotl-badge-web.png" alt="Built with Axolotl" width="200" height="32"/>](https://github.com/OpenAccess-AI-Collective/axolotl)