Views
No views yet
| 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 |

1import transformers
2import torch
3
4if __name__ == "__main__":
5 model_name = "abacaj/phi-2-super"
6 tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)
7
8 model = (
9 transformers.AutoModelForCausalLM.from_pretrained(
10 model_name,
11 )
12 .to("cuda:0")
13 .eval()
14 )
15
16 messages = [
17 {"role": "user", "content": "Hello, who are you?"}
18 ]
19 inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
20 input_ids_cutoff = inputs.size(dim=1)
21
22 with torch.no_grad():
23 generated_ids = model.generate(
24 input_ids=inputs,
25 use_cache=True,
26 max_new_tokens=512,
27 temperature=0.2,
28 top_p=0.95,
29 do_sample=True,
30 eos_token_id=tokenizer.eos_token_id,
31 pad_token_id=tokenizer.pad_token_id,
32 )
33
34 completion = tokenizer.decode(
35 generated_ids[0][input_ids_cutoff:],
36 skip_special_tokens=True,
37 )
38
39 print(completion)1text = "<|endoftext|>[INST] What is your favourite condiment? [/INST]"
2"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|> "
3"[INST] Do you have mayonnaise recipes? [/INST]"1 messages = [
2 {"role": "user", "content": "Hello, who are you?"},
3 {"role": "assistant": "content": "I am ..."}
4 ]
5 inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
