Skip to content

Instantly share code, notes, and snippets.

View qweliant's full-sized avatar
🧟
A zombie, philosophically speaking

Qwelian D Tanner qweliant

🧟
A zombie, philosophically speaking
View GitHub Profile
@qweliant
qweliant / nlp.py
Last active September 1, 2020 17:19
NLP{ class for modeling
from transformers import (
pipeline,
GPT2LMHeadModel,
GPT2Tokenizer
)
class NLP:
def __init__(self):
self.gen_model = GPT2LMHeadModel.from_pretrained('gpt2')
self.gen_tokenizer = GPT2Tokenizer.from_pretrained('gpt2')