We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
使用 PromptModelForSequenceClassification 微調了 utc 後續用兩種方法做預測 分別為 1. 參考 train 使用PromptModelForSequenceClassification 與 2. 參考文件使用 Taskflow 結果不一樣
# 微調後的路徑 task_path = "fine-tuned-checkpoint tokenizer = AutoTokenizer.from_pretrained("utc-base") model = UTC.from_pretrained("utc-base") template = UTCTemplate(tokenizer, training_args.max_seq_length) prompt_model = PromptModelForSequenceClassification( model, template, None, freeze_plm=True, freeze_dropout=True ) model_state = paddle.load(os.path.join(task_path, "model_state.pdparams")) prompt_model.set_state_dict(model_state) trainer = PromptTrainer( model=prompt_model, tokenizer=tokenizer, args=infer_args, criterion=UTCLoss(), train_dataset=None, eval_dataset=None, callbacks=None, ) trainer.predict(test_ds)
# 2. cls = Taskflow("zero_shot_text_classification", model="utc-base", schema=choices, task_path=task_path, precision="fp32") cls("my_text")
兩者結果不一樣, 其中 test_ds 格式為 {"text_a": "my_text", "text_b": "", choices: [a, b, c]}
The text was updated successfully, but these errors were encountered:
gongel
No branches or pull requests
请提出你的问题
使用 PromptModelForSequenceClassification 微調了 utc
後續用兩種方法做預測
分別為 1. 參考 train 使用PromptModelForSequenceClassification 與 2. 參考文件使用 Taskflow 結果不一樣
兩者結果不一樣,
其中 test_ds 格式為 {"text_a": "my_text", "text_b": "", choices: [a, b, c]}
The text was updated successfully, but these errors were encountered: