Jina-14.py
· 227 B · Python
Brut
from transformers import GPT2Tokenizer, GPT2LMHeadModel
class TokenStreamingExecutor(Executor):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.model = GPT2LMHeadModel.from_pretrained('gpt2')
1 | from transformers import GPT2Tokenizer, GPT2LMHeadModel |
2 | |
3 | |
4 | class TokenStreamingExecutor(Executor): |
5 | def __init__(self, **kwargs): |
6 | super().__init__(**kwargs) |
7 | self.model = GPT2LMHeadModel.from_pretrained('gpt2') |