QuantFactory/calme-2.3-phi3-4b-GGUF
0267
language:
- en license: mit library_name: transformers tags:
- axolotl
- finetune
- dpo
- microsoft
- phi
- pytorch
- phi-3
- nlp
- code
- chatml basemodel: microsoft/Phi-3-mini-4k-instruct pipelinetag: text-generation inference: false modelcreator: MaziyarPanahi quantizedby: MaziyarPanahi model-index:
- name: calme-2.3-phi3-4b results:
- task: type: text-generation name: Text Generation dataset: name: AI2 Reasoning Challenge (25-Shot) type: ai2arc config: ARC-Challenge split: test args: numfew_shot: 25 metrics:
- type: accnorm value: 63.48 name: normalized accuracy source: url: https://huggingface.co/spaces/HuggingFaceH4/openllm_leaderboard?query=MaziyarPanahi/calme-2.3-phi3-4b name: Open LLM Leaderboard
- task: type: text-generation name: Text Generation dataset: name: HellaSwag (10-Shot) type: hellaswag split: validation args: numfewshot: 10 metrics:
- type: accnorm value: 80.86 name: normalized accuracy source: url: https://huggingface.co/spaces/HuggingFaceH4/openllm_leaderboard?query=MaziyarPanahi/calme-2.3-phi3-4b name: Open LLM Leaderboard
- task: type: text-generation name: Text Generation dataset: name: MMLU (5-Shot) type: cais/mmlu config: all split: test args: numfewshot: 5 metrics:
- type: acc value: 69.24 name: accuracy source: url: https://huggingface.co/spaces/HuggingFaceH4/openllmleaderboard?query=MaziyarPanahi/calme-2.3-phi3-4b name: Open LLM Leaderboard
- task: type: text-generation name: Text Generation dataset: name: TruthfulQA (0-shot) type: truthfulqa config: multiplechoice split: validation args: numfewshot: 0 metrics:
- type: mc2 value: 60.66 source: url: https://huggingface.co/spaces/HuggingFaceH4/openllmleaderboard?query=MaziyarPanahi/calme-2.3-phi3-4b name: Open LLM Leaderboard
- task: type: text-generation name: Text Generation dataset: name: Winogrande (5-shot) type: winogrande config: winograndexl split: validation args: numfew_shot: 5 metrics:
- type: acc value: 72.77 name: accuracy source: url: https://huggingface.co/spaces/HuggingFaceH4/openllmleaderboard?query=MaziyarPanahi/calme-2.3-phi3-4b name: Open LLM Leaderboard
- task: type: text-generation name: Text Generation dataset: name: GSM8k (5-shot) type: gsm8k config: main split: test args: numfewshot: 5 metrics:
- type: acc value: 74.53 name: accuracy source: url: https://huggingface.co/spaces/HuggingFaceH4/openllmleaderboard?query=MaziyarPanahi/calme-2.3-phi3-4b name: Open LLM Leaderboard
- task: type: text-generation name: Text Generation dataset: name: IFEval (0-Shot) type: HuggingFaceH4/ifeval args: numfewshot: 0 metrics:
- type: instlevelstrictacc and promptlevelstrictacc value: 49.26 name: strict accuracy source: url: https://huggingface.co/spaces/open-llm-leaderboard/openllmleaderboard?query=MaziyarPanahi/calme-2.3-phi3-4b name: Open LLM Leaderboard
- task: type: text-generation name: Text Generation dataset: name: BBH (3-Shot) type: BBH args: numfewshot: 3 metrics:
- type: accnorm value: 37.66 name: normalized accuracy source: url: https://huggingface.co/spaces/open-llm-leaderboard/openllm_leaderboard?query=MaziyarPanahi/calme-2.3-phi3-4b name: Open LLM Leaderboard
- task: type: text-generation name: Text Generation dataset: name: MATH Lvl 5 (4-Shot) type: hendrycks/competitionmath args: numfew_shot: 4 metrics:
- type: exactmatch value: 2.95 name: exact match source: url: https://huggingface.co/spaces/open-llm-leaderboard/openllm_leaderboard?query=MaziyarPanahi/calme-2.3-phi3-4b name: Open LLM Leaderboard
- task: type: text-generation name: Text Generation dataset: name: GPQA (0-shot) type: Idavidrein/gpqa args: numfewshot: 0 metrics:
- type: accnorm value: 9.06 name: accnorm source: url: https://huggingface.co/spaces/open-llm-leaderboard/openllmleaderboard?query=MaziyarPanahi/calme-2.3-phi3-4b name: Open LLM Leaderboard
- task: type: text-generation name: Text Generation dataset: name: MuSR (0-shot) type: TAUR-Lab/MuSR args: numfewshot: 0 metrics:
- type: accnorm value: 7.75 name: accnorm source: url: https://huggingface.co/spaces/open-llm-leaderboard/openllmleaderboard?query=MaziyarPanahi/calme-2.3-phi3-4b name: Open LLM Leaderboard
- task: type: text-generation name: Text Generation dataset: name: MMLU-PRO (5-shot) type: TIGER-Lab/MMLU-Pro config: main split: test args: numfewshot: 5 metrics:
- type: acc value: 31.42 name: accuracy source: url: https://huggingface.co/spaces/open-llm-leaderboard/openllmleaderboard?query=MaziyarPanahi/calme-2.3-phi3-4b name: Open LLM Leaderboard

QuantFactory/calme-2.3-phi3-4b-GGUF
This is quantized version of MaziyarPanahi/calme-2.3-phi3-4b created using llama.cpp
Original Model Card
<img src="./phi-3-instruct.webp" alt="Phi-3 Logo" width="500" style="margin-left:'auto' margin-right:'auto' display:'block'"/>
MaziyarPanahi/calme-2.3-phi3-4b
This model is a fine-tune (DPO) of microsoft/Phi-3-mini-4k-instruct model.
⚡ Quantized GGUF
All GGUF models are available here: MaziyarPanahi/calme-2.3-phi3-4b-GGUF
🏆 Open LLM Leaderboard Evaluation Results
Detailed results can be found here
Leaderboard 2
Leaderboard 1
MaziyarPanahi/calme-2.3-phi3-4b is the best-performing Phi-3-mini-4k model on the Open LLM Leaderboard. (03/06/2024).

Prompt Template
This model uses ChatML prompt template:
<|im_start|>system
{System}
<|im_end|>
<|im_start|>user
{User}
<|im_end|>
<|im_start|>assistant
{Assistant}How to use
You can use this model by using MaziyarPanahi/calme-2.3-phi3-4b as the model name in Hugging Face's transformers library.
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
from transformers import pipeline
import torch
model_id = "MaziyarPanahi/calme-2.3-phi3-4b"
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
# attn_implementation="flash_attention_2"
)
tokenizer = AutoTokenizer.from_pretrained(
model_id,
trust_remote_code=True
)
streamer = TextStreamer(tokenizer)
messages = [
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
{"role": "user", "content": "Who are you?"},
]
# this should work perfectly for the model to stop generating
terminators = [
tokenizer.eos_token_id, # this should be <|im_end|>
tokenizer.convert_tokens_to_ids("<|assistant|>"), # sometimes model stops generating at <|assistant|>
tokenizer.convert_tokens_to_ids("<|end|>") # sometimes model stops generating at <|end|>
]
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
)
generation_args = {
"max_new_tokens": 500,
"return_full_text": False,
"temperature": 0.0,
"do_sample": False,
"streamer": streamer,
"eos_token_id": terminators,
}
output = pipe(messages, **generation_args)
print(output[0]['generated_text'])
