TheBlueObserver's picture
9ba79195d3b31b65713d26b45b864721feccb94c7906e1d081a6ad3c0661e23c
f59e976 verified
|
raw
history blame
912 Bytes
metadata
base_model: johnsnowlabs/JSL-MedPhi2-2.7B
license: cc-by-nc-nd-4.0
tags:
  - phi-2
  - sft
  - medical
  - mlx

TheBlueObserver/JSL-MedPhi2-2.7B-MLX

The Model TheBlueObserver/JSL-MedPhi2-2.7B-MLX was converted to MLX format from johnsnowlabs/JSL-MedPhi2-2.7B using mlx-lm version 0.20.2.

Use with mlx

pip install mlx-lm
from mlx_lm import load, generate

model, tokenizer = load("TheBlueObserver/JSL-MedPhi2-2.7B-MLX")

prompt="hello"

if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
    messages = [{"role": "user", "content": prompt}]
    prompt = tokenizer.apply_chat_template(
        messages, tokenize=False, add_generation_prompt=True
    )

response = generate(model, tokenizer, prompt=prompt, verbose=True)