minghaowu's picture
Upload folder using huggingface_hub
37ea7cc verified
metadata
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

This model is a fine-tuned version of 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 = <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)