| 686 | } |
| 687 | |
| 688 | util::Status TrainerInterface::SaveModel(absl::string_view filename) const { |
| 689 | LOG(INFO) << "Saving model: " << filename; |
| 690 | ModelProto model_proto; |
| 691 | |
| 692 | RETURN_IF_ERROR(Serialize(&model_proto)); |
| 693 | |
| 694 | auto output = filesystem::NewWritableFile(filename.data(), true); |
| 695 | RETURN_IF_ERROR(output->status()); |
| 696 | output->Write(model_proto.SerializeAsString()); |
| 697 | return util::OkStatus(); |
| 698 | } |
| 699 | |
| 700 | util::Status TrainerInterface::SaveVocab(absl::string_view filename) const { |
| 701 | LOG(INFO) << "Saving vocabs: " << filename; |
nothing calls this directly
no test coverage detected