Downloads · 30 days
7
24% of all-time downloads
CCC-Unito/kenji-endo-0.1
kenji-endo-0.1 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
7
24% of all-time downloads
All-time downloads
29
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 git+https://github.com/mrinaldi97/matformer.git
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"CCC-Unito/kenji-endo-0.1",
trust_remote_code=True
)
tokenizer=AutoTokenizer.from_pretrained(model.config._tokenizer_name)
text = "The transformer model is a"
inputs = tokenizer(text,return_tensors='pt')['input_ids'].to(model.device)
with torch.no_grad():
outputs = model.generate(inputs, max_new_tokens=50)
generated = model.matformer_model.tokenizer.decode(outputs[0].tolist())
print(generated)