无法从“变形金刚”中导入名称“GPT2ForQuestionAnswering”

问题描述 投票:0回答:0

1 将 pandas 导入为 pd 2个进口手电筒 ----> 3 from transformers import GPT2Tokenizer, GPT2ForQuestionAnswering, AdamW 4 从变形金刚导入 default_data_collator 5 从 torch.utils.data 导入 DataLoader

import pandas as pd
import torch
from transformers import GPT2Tokenizer, GPT2ForQuestionAnswering, AdamW
from transformers import default_data_collator
from torch.utils.data import DataLoader
from transformers import datasets
from transformers import TriviaQAProcessor, set_seed
from transformers import TrainingArguments, Trainer
pip torch gpt-2
© www.soinside.com 2019 - 2024. All rights reserved.