How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="DarqueDante/Phi3Mix", trust_remote_code=True)
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("DarqueDante/Phi3Mix", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("DarqueDante/Phi3Mix", trust_remote_code=True)
messages = [
    {"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
	messages,
	add_generation_prompt=True,
	tokenize=True,
	return_dict=True,
	return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Quick Links

Phi3Mix

Phi3Mix is a Mixture of Experts (MoE) made with the following models using Phi3_LazyMergekit:

🧩 Configuration

base_model: microsoft/Phi-3-medium-128k-instruct
gate_mode: cheap_embed
experts_per_token: 1
dtype: float16
experts:
  - source_model: microsoft/Phi-3-medium-128k-instruct
    positive_prompts: ["research, logic, math, science"]
  - source_model: microsoft/Phi-3-medium-128k-instruct
    positive_prompts: ["creative, art"]

πŸ’» Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model = "DarqueDante/Phi3Mix"

tokenizer = AutoTokenizer.from_pretrained(model)

model = AutoModelForCausalLM.from_pretrained(
    model,
    trust_remote_code=True,
)

prompt="How many continents are there?"
input = f"<|system|>You are a helpful AI assistant.<|end|><|user|>{prompt}<|assistant|>"
tokenized_input = tokenizer.encode(input, return_tensors="pt")

outputs = model.generate(tokenized_input, max_new_tokens=128, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(tokenizer.decode(outputs[0]))
Downloads last month
4
Safetensors
Model size
25B params
Tensor type
F16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for DarqueDante/Phi3Mix

Finetuned
(7)
this model