Views
No views yet

cheap_embed where each model is assigned a vector representation of words - such as experts for scientific work, reasoning, math etc.1base_model: microsoft/Phi-3-mini-128k-instruct
2gate_mode: cheap_embed
3dtype: float16
4experts:
5 - source_model: microsoft/Phi-3-mini-128k-instruct
6 positive_prompts: ["research, logic, math, science"]
7 - source_model: microsoft/Phi-3-mini-128k-instruct
8 positive_prompts: ["creative, art"]1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4
5model = "paulilioaica/MixtureOfPhi3"
6
7tokenizer = AutoTokenizer.from_pretrained(model)
8model = AutoModelForCausalLM.from_pretrained(
9 model,
10 trust_remote_code=True,
11)
12
13prompt="How many continents are there?"
14input = f"<|system|>\nYou are a helpful AI assistant.<|end|>\n<|user|>{prompt}\n<|assistant|>"
15tokenized_input = tokenizer.encode(input, return_tensors="pt")
16
17outputs = model.generate(tokenized_input, max_new_tokens=128, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
18print(tokenizer.decode(outputs[0]))