import gradio as gr from transformers import BertTokenizer,BertModel model_name = 'hfl/chinese-roberta-wwm-ext' config = BertConfig.from_pretrained(model_name) # 这个方法会自动从官方的s3数据库下载模型配置、参数等信息(代码中已配置好位置) tokenizer = BertTokenizer.from_pretrained(model_name) # 这个方法会自动从官方的s3数据库读取文件下的vocab.txt文件 model = BertModel.from_pretrained(model_name) # 这个方法会自动从官方的s3数据库下载模型信息 description = "BigGAN text-to-image demo." title = "BigGAN ImageNet" interface = gr.Interface.load("huggingface/osanseviero/BigGAN-deep-128", description=description, title = title, examples=[["american robin"]] ) interface.launch()