Sponsored by
Vmake Labs Video Enhancer
-Vmake Labs Video Enhancer uses AI to improve video quality, restore details, reduce blur, and upscale videos to 8K.
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|>
Runs of afrideva Phi-3-mini-4k-grammar-correction-GGUF on huggingface.co
760
Total runs
12
24-hour runs
-12
3-day runs
-27
7-day runs
13
30-day runs
More Information About Phi-3-mini-4k-grammar-correction-GGUF huggingface.co Model
More Phi-3-mini-4k-grammar-correction-GGUF license Visit here:
Phi-3-mini-4k-grammar-correction-GGUF huggingface.co is an AI model on huggingface.co that provides Phi-3-mini-4k-grammar-correction-GGUF's model effect (), which can be used instantly with this afrideva Phi-3-mini-4k-grammar-correction-GGUF model. huggingface.co supports a free trial of the Phi-3-mini-4k-grammar-correction-GGUF model, and also provides paid use of the Phi-3-mini-4k-grammar-correction-GGUF. Support call Phi-3-mini-4k-grammar-correction-GGUF model through api, including Node.js, Python, http.
Phi-3-mini-4k-grammar-correction-GGUF huggingface.co is an online trial and call api platform, which integrates Phi-3-mini-4k-grammar-correction-GGUF's modeling effects, including api services, and provides a free online trial of Phi-3-mini-4k-grammar-correction-GGUF, you can try Phi-3-mini-4k-grammar-correction-GGUF online for free by clicking the link below.
afrideva Phi-3-mini-4k-grammar-correction-GGUF online free url in huggingface.co:
Phi-3-mini-4k-grammar-correction-GGUF is an open source model from GitHub that offers a free installation service, and any user can find Phi-3-mini-4k-grammar-correction-GGUF on GitHub to install. At the same time, huggingface.co provides the effect of Phi-3-mini-4k-grammar-correction-GGUF install, users can directly use Phi-3-mini-4k-grammar-correction-GGUF installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Phi-3-mini-4k-grammar-correction-GGUF install url in huggingface.co: