Downloads · 30 days
9
33% of all-time downloads
mrinaldi/albertina-micro-crazy-model
albertina-micro-crazy-model is a machine learning model from mrinaldi. 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
9
33% of all-time downloads
All-time downloads
27
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(
"mrinaldi/albertina-micro-crazy-model",
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)