Downloads · 30 days
72
8% of all-time downloads
ayousanz/japanese-mistral-0.3b-base
japanese-mistral-0.3b-base is a text generation model from ayousanz. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
72
8% of all-time downloads
All-time downloads
855
Public
Parameters
355M
6.4 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors1.4 GB · 66%
From the Hugging Face model README
This model is a fine-tuned version of None on an unknown dataset. It achieves the following results on the evaluation set:
More information needed
***** train metrics *****
epoch = 13.91 train_loss = 2.205
***** eval metrics *****
epoch = 13.91 eval_loss = 2.4 perplexity = 11.0228
The following hyperparameters were used during training:
from transformers import pipeline
pipe = pipeline("text-generation", model="ayousanz/japanese-mistral-0.3b-base")
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
import torch
MODEL_NAME = "ayousanz/japanese-mistral-0.3b-base"
torch.set_float32_matmul_precision('high')
DEVICE = "cuda"
if torch.cuda.is_available():
print("cuda")
DEVICE = "cuda"
else:
print("cpu")
DEVICE = "cpu"
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME,use_fast=False)
model = AutoModelForCausalLM.from_pretrained(
MODEL_NAME,
trust_remote_code=True,
).to(DEVICE)
prompt = "大規模言語モデルとは、"
inputs = tokenizer(prompt, add_special_tokens=False,return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
inputs["input_ids"],
max_new_tokens=256,
do_sample=True,
early_stopping=False,
top_p=0.95,
top_k=50,
temperature=0.9,
no_repeat_ngram_size=2,
num_beams=3
)
outputs_txt = tokenizer.decode(outputs[0])
print(outputs_txt)