Closed yslu-TW closed 1 year ago
pip install rocketqa==1.1.0版本 cross_encoder.py沒有儲存config.json那幾行程式,github上有,
save_path = os.path.join(args.save_model_path,
"step_" + str(steps))
fluid.io.save_persistables(self.exe, save_path, train_program)
config_save_path = os.path.join(args.save_model_path, "config.json")
json.dump(self.config_dict, open(config_save_path, "w"))
shutil.copy(args.ernie_config_path, args.save_model_path)
shutil.copy(args.vocab_path, args.save_model_path)
然後訓練完成不會跳任何訊息 可以把錯誤訊息印出來看看
except fluid.core.EOFException as eof:
log.info(
"error: %s" %
(eof))
另外可加上把skip_steps印出來才知道有正常再運行 cross_encoder.py中 def _parse_train_args中補上
if "skip_steps" in config_dict:
self.args.skip_steps = config_dict['skip_steps']
example.py
cross_encoder.train(train_set, 2, 'ce_qa_models', save_steps=10,skip_steps=10, learning_rate=1e-5, log_folder='ce_qa_log')
Load pretraining parameters from dureader_cross_encoder 後跳出程序 dureader_cross_encoder有下載下來