Downloads · 30 days
11
18% of all-time downloads
battsengel4567/BataAiNew0.4V
BataAiNew0.4V is a machine learning model from battsengel4567. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Phi-3-mini-4k-instruct загварыг монгол хэлний датасет дээр fine-tune хийсэн.
Downloads · 30 days
11
18% of all-time downloads
All-time downloads
62
Public
Parameters
3.8B
7.6 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors7.6 GB · 100%
From the Hugging Face model README
Phi-3-mini-4k-instruct загварыг монгол хэлний датасет дээр fine-tune хийсэн.
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "battsengel4567/BataAiNew0.4V"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
system = "Чи бол BataAI — монгол хэлээр туслах чадварлаг хиймэл оюун ухаан."
def chat(user_input):
text = "<|system|>\n" + system + "<|end|>\n<|user|>\n" + user_input + "<|end|>\n<|assistant|>\n"
inputs = tokenizer(text, return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(
**inputs,
max_new_tokens=200,
temperature=0.7,
do_sample=True,
repetition_penalty=1.1,
pad_token_id=tokenizer.eos_token_id,
)
return tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
print(chat("Чи хэн бэ?"))