Downloads · 30 days
6
15% of all-time downloads
Yooko/gpt3-finnish-small-ft-AbirateEN
gpt3-finnish-small-ft-AbirateEN is a text generation model from Yooko. Use it when you need the model to write or continue text. It is set up for adapter-transformers. The card lists the license as mit.
This model is a PEFT model based on TurkuNLP/gpt3-finnish-small
Downloads · 30 days
6
15% of all-time downloads
All-time downloads
41
Public
Repo size
2.4 MB
Likes
0
Public
Click a slice to open those files.
.bin2.4 MB · 100%
From the Hugging Face model README
This model is a PEFT model based on TurkuNLP/gpt3-finnish-small
import torch
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer
peft_model_id = "Yooko/gpt3-finnish-small-ft-AbirateEN"
config = PeftConfig.from_pretrained(peft_model_id)
model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True, device_map='auto')
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
# Load the Lora model
model = PeftModel.from_pretrained(model, peft_model_id)
batch = tokenizer("Two things are infinite: ", return_tensors='pt')
with torch.cuda.amp.autocast():
output_tokens = model.generate(**batch, max_new_tokens=50)
print('\n\n', tokenizer.decode(output_tokens[0], skip_special_tokens=True))