Update app.py
Browse files
app.py
CHANGED
@@ -7,9 +7,9 @@ Description:
|
|
7 |
FilePath: /zuo/app.py
|
8 |
'''
|
9 |
import gradio as gr
|
10 |
-
from transformers import BertTokenizer,
|
11 |
-
tokenizer = BertTokenizer.from_pretrained("./")
|
12 |
-
model =
|
13 |
text_generator = TextGenerationPipeline(model, tokenizer)
|
14 |
|
15 |
def poem(cls):
|
|
|
7 |
FilePath: /zuo/app.py
|
8 |
'''
|
9 |
import gradio as gr
|
10 |
+
from transformers import BertTokenizer, TFGPT2LMHeadModel,TextGenerationPipeline
|
11 |
+
tokenizer = BertTokenizer.from_pretrained("./tokenizer_config.json")
|
12 |
+
model = TFGPT2LMHeadModel.from_pretrained("./config.json")
|
13 |
text_generator = TextGenerationPipeline(model, tokenizer)
|
14 |
|
15 |
def poem(cls):
|