最后活跃于 1731289844

knox 修订了这个 Gist 1731289844. 跳至此修订

1 file changed, 7 insertions

Jina-14.py(file created)

@@ -0,0 +1,7 @@
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')
更新 更早