Skip to content

Instantly share code, notes, and snippets.

View junyann's full-sized avatar
🎃

Jun Yan junyann

🎃
View GitHub Profile
from transformers import GPT2Tokenizer, GPT2LMHeadModel
import torch
from torch.nn import CrossEntropyLoss
from tqdm import trange
max_length = 24
batch_size = 200