Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用 pCLUE-main 项目里面的datasets里面的120万数据训练后,效果不佳 #20

Open
yzhzx opened this issue Jun 6, 2023 · 1 comment

Comments

@yzhzx
Copy link

yzhzx commented Jun 6, 2023

使用pCLUE-main项目里的数据训练后, 加载模型 , 同样的代码 , 使用本地训练的和示例代码出来的结果完全不同 , 请问需要怎么改进
示例代码
tokenizer = T5Tokenizer.from_pretrained("ClueAI/PromptCLUE")
model = T5ForConditionalGeneration.from_pretrained("ClueAI/PromptCLUE")
print(answer('''信息抽取:
今天我向大家介绍一下一个人。他是张丰毅1956年9月1日出生于河南省南阳市唐河县,1982年毕业于北京电影学院,是中国电影协会理事。1993年,与其他演员主演电影《霸王别姬》
问题:主角,嘉宾,演员,改编自,面积,出生地,学校,成员,出生时间
答案:''',sample=False))

输出结果:
地址:河南省南阳市唐河县
组织:北京电影学院,中国电影协会
名字:张丰毅
职位:理事

本地模型
tokenizer = T5Tokenizer.from_pretrained("ClueAI/PromptCLUE")
model = T5ForConditionalGeneration.from_pretrained("outputs/model_files/")
#或者以下方式引用
tokenizer = AutoTokenizer.from_pretrained("ClueAI/PromptCLUE")
model = AutoModelForSeq2SeqLM.from_pretrained("outputs/model_files/")
print(answer('''信息抽取:
今天我向大家介绍一下一个人。他是张丰毅1956年9月1日出生于河南省南阳市唐河县,1982年毕业于北京电影学院,是中国电影协会理事。1993年,与其他演员主演电影《霸王别姬》
问题:主角,嘉宾,演员,改编自,面积,出生地,学校,成员,出生时间
答案:''',sample=False))
输出结果:
演员:张丰毅1956年9月1日出生于河南省南阳市唐河县

@yzhzx
Copy link
Author

yzhzx commented Jun 6, 2023

训练过程是按照 ClueAI/pCLUE-main/Fine_tunining_PyTorch.ipynb 进行的 , 本地显存不足使用
"TRAIN_BATCH_SIZE": 4, # training batch size, 8
"VALID_BATCH_SIZE": 4, # validation batch size,8
参数进行的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant