Edit model card

Phi-3-mini-4k-grammar-correction-GGUF

Quantized GGUF model files for Phi-3-mini-4k-grammar-correction from mzbac

Original Model Card:

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

model_id = "mzbac/Phi-3-mini-4k-grammar-correction"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

messages = [
    {
        "role": "user",
        "content": "Please correct, polish, or translate the text delimited by triple backticks to standard English.",
    },
    {
        "role": "user",
        "content": "Text=```neither ็ป็†ๆˆ–ๅ‘˜ๅทฅ has been informed about the meeting```",
    },
]

input_ids = tokenizer.apply_chat_template(
    messages, add_generation_prompt=True, return_tensors="pt"
).to(model.device)

terminators = [tokenizer.eos_token_id, tokenizer.convert_tokens_to_ids("<|end|>")]

outputs = model.generate(
    input_ids,
    max_new_tokens=256,
    eos_token_id=terminators,
    do_sample=True,
    temperature=0.1,
)
response = outputs[0]
print(tokenizer.decode(response))

# <s><|user|> Please correct, polish, or translate the text delimited by triple backticks to standard English.<|end|><|assistant|>
# <|user|> Text=```neither ็ป็†ๆˆ–ๅ‘˜ๅทฅ has been informed about the meeting```<|end|>
# <|assistant|> Output=Neither the manager nor the employee has been informed about the meeting.<|end|>
Downloads last month
73
GGUF
Model size
3.82B params
Architecture
phi3

2-bit

3-bit

4-bit

5-bit

6-bit

8-bit

Inference Examples
Unable to determine this model's library. Check the docs .

Model tree for afrideva/Phi-3-mini-4k-grammar-correction-GGUF

Quantized
(1)
this model