Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
3 |
|
4 |
-
tokenizer = GPT2Tokenizer.from_pretrained('gpt2
|
5 |
-
model = GPT2LMHeadModel.from_pretrained('gpt2
|
6 |
|
7 |
def generator(text):
|
8 |
input_ids = tokenizer.encode(text, return_tensors = 'pt')
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
3 |
|
4 |
+
tokenizer = GPT2Tokenizer.from_pretrained('gpt2')
|
5 |
+
model = GPT2LMHeadModel.from_pretrained('gpt2', pad_token_id = tokenizer.eos_token_id)
|
6 |
|
7 |
def generator(text):
|
8 |
input_ids = tokenizer.encode(text, return_tensors = 'pt')
|