Downloads · 30 days
161
10% of all-time downloads
RichardErkhov/abacaj_-_phi-2-super-gguf
abacaj_-_phi-2-super-gguf is a machine learning model from RichardErkhov. 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
161
10% of all-time downloads
All-time downloads
1.7K
Public
Repo size
32.2 GB
Likes
0
Public
Click a slice to open those files.
.gguf37.4 GB · 100%
From the Hugging Face model README
Quantization made by Richard Erkhov.
phi-2-super - GGUF
| Name | Quant method | Size |
|---|---|---|
| phi-2-super.Q2_K.gguf | Q2_K | 1.03GB |
| phi-2-super.IQ3_XS.gguf | IQ3_XS | 1.12GB |
| phi-2-super.IQ3_S.gguf | IQ3_S | 1.16GB |
| phi-2-super.Q3_K_S.gguf | Q3_K_S | 1.16GB |
| phi-2-super.IQ3_M.gguf | IQ3_M | 1.23GB |
| phi-2-super.Q3_K.gguf | Q3_K | 1.33GB |
| phi-2-super.Q3_K_M.gguf | Q3_K_M | 1.33GB |
| phi-2-super.Q3_K_L.gguf | Q3_K_L | 1.47GB |
| phi-2-super.IQ4_XS.gguf | IQ4_XS | 1.43GB |
| phi-2-super.Q4_0.gguf | Q4_0 | 1.49GB |
| phi-2-super.IQ4_NL.gguf | IQ4_NL | 1.5GB |
| phi-2-super.Q4_K_S.gguf | Q4_K_S | 1.51GB |
| phi-2-super.Q4_K.gguf | Q4_K | 1.62GB |
| phi-2-super.Q4_K_M.gguf | Q4_K_M | 1.62GB |
| phi-2-super.Q4_1.gguf | Q4_1 | 1.65GB |
| phi-2-super.Q5_0.gguf | Q5_0 | 1.8GB |
| phi-2-super.Q5_K_S.gguf | Q5_K_S | 1.8GB |
| phi-2-super.Q5_K.gguf | Q5_K | 1.87GB |
| phi-2-super.Q5_K_M.gguf | Q5_K_M | 1.87GB |
| phi-2-super.Q5_1.gguf | Q5_1 | 1.95GB |
| phi-2-super.Q6_K.gguf | Q6_K | 2.13GB |
| phi-2-super.Q8_0.gguf | Q8_0 | 2.75GB |
license: mit license_link: https://huggingface.co/microsoft/phi-2/resolve/main/LICENSE language:
Base Model: microsoft/phi-2

import transformers
import torch
if __name__ == "__main__":
model_name = "abacaj/phi-2-super"
tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)
model = (
transformers.AutoModelForCausalLM.from_pretrained(
model_name,
)
.to("cuda:0")
.eval()
)
messages = [
{"role": "user", "content": "Hello, who are you?"}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
input_ids_cutoff = inputs.size(dim=1)
with torch.no_grad():
generated_ids = model.generate(
input_ids=inputs,
use_cache=True,
max_new_tokens=512,
temperature=0.2,
top_p=0.95,
do_sample=True,
eos_token_id=tokenizer.eos_token_id,
pad_token_id=tokenizer.pad_token_id,
)
completion = tokenizer.decode(
generated_ids[0][input_ids_cutoff:],
skip_special_tokens=True,
)
print(completion)
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]"
You don't need to do it manually if you use the HF transformers tokenizer:
messages = [
{"role": "user", "content": "Hello, who are you?"},
{"role": "assistant": "content": "I am ..."}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
