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