Update app.py
Browse files
app.py
CHANGED
@@ -4,8 +4,9 @@ import torch
|
|
4 |
import gradio as gr
|
5 |
import torch.nn.functional as F
|
6 |
|
7 |
-
from transformers import BertTokenizer, GPT2LMHeadModel
|
8 |
-
tokenizer = BertTokenizer.from_pretrained("supermy/poetry")
|
|
|
9 |
model = GPT2LMHeadModel.from_pretrained("supermy/poetry")
|
10 |
model.eval()
|
11 |
|
|
|
4 |
import gradio as gr
|
5 |
import torch.nn.functional as F
|
6 |
|
7 |
+
from transformers import BertTokenizer, GPT2LMHeadModel,PreTrainedTokenizerFast
|
8 |
+
# tokenizer = BertTokenizer.from_pretrained("supermy/poetry")
|
9 |
+
tokenizer = BertTokenizer(vocab_file="poetry-bpe.json")
|
10 |
model = GPT2LMHeadModel.from_pretrained("supermy/poetry")
|
11 |
model.eval()
|
12 |
|