Downloads · 30 days
11
3% of all-time downloads
BenasSabalys/gpt2-lithuanian-wiki
gpt2-lithuanian-wiki is a machine learning model from BenasSabalys. 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.
probably proofread and complete it, then remove this comment. --
Downloads · 30 days
11
3% of all-time downloads
All-time downloads
318
Public
Repo size
994 MB
Likes
0
Public
Click a slice to open those files.
.h5497 MB · 100%
From the Hugging Face model README
This is a gpt2 model trained on 142 612 different Lithuanian Wikipedia articles + 11 405 articles taken from delfi.lt, ve.lt and respublika.lt news portals.
This is a model I trained when writing my bachelors. You can use it anywhere you want.
Model reached 36.83% accuracy with training data and 37.02% with validation data
Transformers 3.5.0 TensorFlow 2.4.1 Tokenizers 0.12.1 Torch 1.4.0
How to use it:
import tensorflow as tf
from transformers import WEIGHTS_NAME, CONFIG_NAME
from transformers import GPT2Config, TFGPT2LMHeadModel, GPT2Tokenizer
import os
output_dir = '...' #local file or link to this page
tokenizer = GPT2Tokenizer.from_pretrained(output_dir)
model = TFGPT2LMHeadModel.from_pretrained(output_dir)
text = "Siekdamas"
# encoding the input text
input_ids = tokenizer.encode(text, return_tensors='tf')
# getting out output
beam_outputs = model.generate(
input_ids,
max_length = 150,
num_beams = 5,
temperature = 0.7,
no_repeat_ngram_size=2,
num_return_sequences=5
)
print(tokenizer.decode(beam_outputs[0]))