hf_mirrors/dolphin-2.9.2-Phi-3-Medium-openmind
Model Introduction
Files & versions
Analysis

Dolphin 2.9.2 Phi 3 Medium 🐬

Curated and trained by Eric Hartford, Lucas Atkins, Fernando Fernandes, and with help from the community of Cognitive Computations

Discord Discord: https://discord.gg/cognitivecomputations

Our appreciation for the sponsor of Dolphin 2.9.2:

  • Crusoe Cloud - provided excellent on-demand 8xL40Snode

This model is based on Phi-3-Medium-Instruct-4k, and is governed by the MIT license with which Microsoft released Phi-3.

Since Microsoft only released the fine-tuned model - Dolphin-2.9.2-Phi-3-Medium has not been entirely cleaned of refusals.

The base model has 4k context, and the qLoRA fine-tuning was with 4k sequence length.

It took 3.5 days on 8xL40S node provided by Crusoe Cloud

This model uses the ChatML prompt template.

example:

<|im_start|>system
You are Dolphin, a helpful AI assistant.<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant

Dolphin-2.9.2 has a variety of instruction, conversational, and coding skills. It also has initial agentic abilities and supports function calling. We have filtered the dataset to remove alignment and bias. This makes the model more compliant. You are advised to implement your own alignment layer before exposing the model as a service. Please read my blog post about uncensored models. https://erichartford.com/uncensored-models You are responsible for any content you create using this model. Enjoy responsibly.

image/png

Built with Axolotl

How to use in openmind

from openmind import AutoTokenizer, AutoModelForCausalLM, is_torch_npu_available
from openmind_hub import snapshot_download
import torch.nn.functional as F
from torch import Tensor
import openmind
import torch
import argparse

def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--model_name_or_path",
        type=str,
        help="Path to model",
        default="jeffding/dolphin-2.9.2-Phi-3-Medium-openmind",
    )
    args = parser.parse_args()
    return args

def main():
    args = parse_args()
    model_path = args.model_name_or_path

    if is_torch_npu_available():
        device = "npu:0"
    else:
        device = "cpu"
        
    model = AutoModelForCausalLM.from_pretrained(model_path).to(device)
    tokenizer = AutoTokenizer.from_pretrained(model_path)
    model.eval()

    prompt = 'Can you introduct me to shanghai?\nA:'
    input_ids = tokenizer(prompt, return_tensors="pt").input_ids.to(device)
    tokens = model.generate(input_ids, max_length=50)
    print( tokenizer.decode(tokens[0].tolist(), skip_special_tokens=True) )
    # Q: What is the largest bird?\nA: The largest bird is a black-headed gull.
    
if __name__ == "__main__":
    main()

evals: