gpt-2-chinese-wiki.zip
PyTorch GPT
在线加载模型地址

确定自己使用的框架并导入对应的库。导入库实现样例代码可参考 文档中心-预训练模型使用教程

在代码中实现加载预训练模型地址

调用模型的实现方法
# 必须使用该方法下载模型,然后加载
from flyai.utils import remote_helper
# 下载到项目中的data/input/文件夹,默认会自动解压,具体文件路径可以下之后查看使用
path = remote_helper.get_remote_date('https://www.flyai.com/m/gpt-2-chinese-wiki.zip')

import os 
from transformers import BertTokenizer, GPT2LMHeadModel, GPT2Config

model = GPT2LMHeadModel.from_pretrained(path)
tokenizer = BertTokenizer(vocab_file=os.join.path(path, vocab_small.txt))