--- license: mit base_model: microsoft/phi-2 tags: - generated_from_trainer datasets: - teknium/OpenHermes-2.5 model-index: - name: phi-2-OpenHermes-2.5 results: [] --- # phi-2-OpenHermes-2.5 I converted [minghaowu/phi-2-OpenHermes-2.5](https://huggingface.co/minghaowu/phi-2-OpenHermes-2.5) to GGUF and quantized it to my favorite quantizations. A phi-2 fine-tuned on [OpenHermes-2.5](https://huggingface.co/datasets/teknium/OpenHermes-2.5). I quickly quantized this model using a modified version of [AutoGGUF](https://t.co/oUuxN2fvSX) from [Maxime Labonne](https://huggingface.co/mlabonne) The prompt format is a little bit guesswork but it seems to work. Here is my Ollama modelfile: ``` FROM ./phi-2-openhermes-2.5.Q5_K_M.gguf PARAMETER num_ctx 2048 TEMPLATE """{{ .System }} ### USER: {{ .Prompt }}<|endoftext|> ### ASSISTANT: """ PARAMETER stop "<|endoftext|>" ``` Many Kudos to [Microsoft](https://huggingface.co/microsoft), [Teknium](https://huggingface.co/datasets/teknium) and [Minghao Wu]((https://huggingface.co/minghaowu) --- # Original Modelcard This model is a fine-tuned version of [microsoft/phi-2](https://huggingface.co/microsoft/phi-2) on the teknium/OpenHermes-2.5 dataset. ## Model description More information needed ## Intended uses & limitations More information needed ## Training and evaluation data More information needed ## Training procedure ### Training hyperparameters The following hyperparameters were used during training: - learning_rate: 5e-05 - train_batch_size: 4 - eval_batch_size: 8 - seed: 42 - distributed_type: multi-GPU - num_devices: 2 - gradient_accumulation_steps: 16 - total_train_batch_size: 128 - total_eval_batch_size: 16 - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08 - lr_scheduler_type: linear - lr_scheduler_warmup_ratio: 0.1 - num_epochs: 1.0 ### Training results ### Framework versions - Transformers 4.37.2 - Pytorch 2.0.1+cu117 - Datasets 2.16.1 - Tokenizers 0.15.1 ### Inference ``` from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline model_id = "minghaowu/phi-2-OpenHermes-2.5" tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto") pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, device_map="auto") your_instruction = infer_prompt = f"### USER: {your_instruction} <|endoftext|>\n### ASSISTANT:" output = pipe(infer_prompt, do_sample=True, max_new_tokens=256)[0]["generated_text"] print(output) ```