Text Generation
Transformers
Safetensors
English
phi
convAI
conversational
custom_code
text-generation-inference
4-bit precision
gptq
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("RedHatAI/phi-2-super-marlin", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("RedHatAI/phi-2-super-marlin", 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
Phi-2 Super (SFT + cDPO)
- Model creator: Anton Bacaj
- Original model: Phi-2 Super
Description
This repo contains 4-bit Marlin format model files for abacaj's Phi-2 Super
Phi-2-super (SFT + cDPO)
Base Model: microsoft/phi-2
Chat template
The model uses the same chat template as found in Mistral instruct models:
text = "<|endoftext|>[INST] What is your favourite condiment? [/INST]"
"Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!<|endoftext|> "
"[INST] Do you have mayonnaise recipes? [/INST]"
MT-bench / heval
- Downloads last month
- 23



# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="RedHatAI/phi-2-super-marlin", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)