未验证 提交 daf88968 编写于 作者: L lijianshe02 提交者: GitHub

fix bug that saved optimal model path in test_analyzer_save_model con… (#17555)


* modify saved model path in analyzer_save_model.cc test=develop
上级 43d15b9d
...@@ -86,7 +86,7 @@ inference_analysis_test(test_analyzer_small_dam SRCS analyzer_dam_tester.cc ...@@ -86,7 +86,7 @@ inference_analysis_test(test_analyzer_small_dam SRCS analyzer_dam_tester.cc
EXTRA_DEPS ${INFERENCE_EXTRA_DEPS} EXTRA_DEPS ${INFERENCE_EXTRA_DEPS}
ARGS --infer_model=${DAM_SMALL_INSTALL_DIR}/model --infer_data=${DAM_SMALL_INSTALL_DIR}/data.txt --max_turn_num=1) ARGS --infer_model=${DAM_SMALL_INSTALL_DIR}/model --infer_data=${DAM_SMALL_INSTALL_DIR}/data.txt --max_turn_num=1)
# save model #save model
inference_analysis_api_test(test_analyzer_save_model ${DAM_SMALL_INSTALL_DIR} analyzer_save_model_tester.cc) inference_analysis_api_test(test_analyzer_save_model ${DAM_SMALL_INSTALL_DIR} analyzer_save_model_tester.cc)
# chinese_ner # chinese_ner
......
...@@ -321,7 +321,6 @@ TEST(Analyzer_dam, compare_determine) { ...@@ -321,7 +321,6 @@ TEST(Analyzer_dam, compare_determine) {
CompareDeterministic(reinterpret_cast<const PaddlePredictor::Config *>(&cfg), CompareDeterministic(reinterpret_cast<const PaddlePredictor::Config *>(&cfg),
input_slots_all); input_slots_all);
} }
// Save optim model // Save optim model
TEST(Analyzer_dam, save_optim_model) { TEST(Analyzer_dam, save_optim_model) {
AnalysisConfig cfg; AnalysisConfig cfg;
......
...@@ -34,7 +34,8 @@ TEST(Analyzer, save_model) { ...@@ -34,7 +34,8 @@ TEST(Analyzer, save_model) {
AnalysisConfig cfg; AnalysisConfig cfg;
SetConfig(&cfg); SetConfig(&cfg);
cfg.SetModel(FLAGS_infer_model + "/__model__", FLAGS_infer_model + "/param"); cfg.SetModel(FLAGS_infer_model + "/__model__", FLAGS_infer_model + "/param");
std::string optimModelPath = FLAGS_infer_model + "/saved_optim_model"; // ensure the path being unique
std::string optimModelPath = FLAGS_infer_model + "/only_for_save_model_test";
mkdir(optimModelPath.c_str(), 0777); mkdir(optimModelPath.c_str(), 0777);
SaveOptimModel(&cfg, optimModelPath); SaveOptimModel(&cfg, optimModelPath);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册