Downloads · 30 days
7
21% of all-time downloads
i2xmortal/Immortal-phi-3-experts-instruct
Immortal-phi-3-experts-instruct is a machine learning model from i2xmortal. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
7
21% of all-time downloads
All-time downloads
33
Public
Parameters
6.2B
12.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors12.5 GB · 100%
From the Hugging Face model README
license: apache-2.0
base_model: microsoft/Phi-3-mini-4k-instruct
gate_mode: cheap_embed
experts_per_token: 1
dtype: float16
experts:
- source_model: microsoft/Phi-3-mini-4k-instruct
positive_prompts: ["If the user asks about your name you should say my name is expert1"]
- source_model: microsoft/Phi-3-mini-4k-instruct
positive_prompts: ["If the user asks about 'how are you', you should say as 'expert2 im very fine'"]
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model = "i2xmortal/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]))