Downloads · 30 days
2
1% of all-time downloads
CCC-Unito/kenji-endo-1.0
kenji-endo-1.0 is a machine learning model from CCC-Unito. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Downloads · 30 days
2
1% of all-time downloads
All-time downloads
162
Public
Repo size
1.3 GB
Likes
0
Public
Click a slice to open those files.
.ckpt1.3 GB · 100%
From the Hugging Face model README
Trained using Matformer.
pip install transformers torch pytorch-lightning einops
pip install git+https://github.com/mrinaldi97/matformer.git
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"CCC-Unito/kenji-endo-1.0",
trust_remote_code=True
)
tokenizer=AutoTokenizer.from_pretrained("CCC-Unito/Minerva-Tokenizer-Special-Tokens")
text = "Il fiume quel giorno era in piena e il cielo minacciava tempesta"
inputs = tokenizer(text,return_tensors='pt',add_special_tokens=True)['input_ids'].to(model.device)
outputs = model.generate(inputs.to(model.device), max_new_tokens=50, temperature=1)
generated = tokenizer.decode(outputs[0].tolist())
print(generated)