Downloads · 30 days
427
14% of all-time downloads
ce-lery/mistral-2b-base
mistral-2b-base is a text generation model from ce-lery. 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
427
14% of all-time downloads
All-time downloads
3K
Public
Parameters
2.1B
4.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4.3 GB · 100%
From the Hugging Face model README
Welcome to my model card!
This Model feature is ...
Yukkuri shite ittene!
<!-- ## Intended uses & limitations More information needed -->from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_path = "ce-lery/mistral-2b-base"
torch.set_float32_matmul_precision('high')
device = "cuda"
if (device != "cuda" and device != "cpu"):
device = "cpu"
tokenizer = AutoTokenizer.from_pretrained(model_path,use_fast=False)
model = AutoModelForCausalLM.from_pretrained(model_path,
trust_remote_code=True,
).to(device)
prompt = "自然言語処理とは、"
inputs = tokenizer(prompt,
add_special_tokens=True,
return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
inputs["input_ids"],
max_new_tokens=4096,
do_sample=True,
early_stopping=False,
top_p=0.95,
top_k=50,
temperature=0.7,
no_repeat_ngram_size=2,
num_beams=3
)
print(outputs.tolist()[0])
outputs_txt = tokenizer.decode(outputs[0])
print(outputs_txt)
40B token. The contents are following.
Please refer ce-lery/mistral-2b-recipe.
The Guide for this repository is published here. It is written in Japanese.
The following hyperparameters were used during training:
Please refer here.