| 1154 | } |
| 1155 | |
| 1156 | util::Status SaveModelProto(absl::string_view filename, |
| 1157 | const ModelProto &model_proto) { |
| 1158 | if (filename.empty()) { |
| 1159 | return util::NotFoundError("model file path should not be empty."); |
| 1160 | } |
| 1161 | auto output = filesystem::NewWritableFile(filename, true); |
| 1162 | RETURN_IF_ERROR(output->status()); |
| 1163 | CHECK_OR_RETURN(output->Write(model_proto.SerializeAsString())); |
| 1164 | |
| 1165 | return util::OkStatus(); |
| 1166 | } |
| 1167 | } // namespace io |
| 1168 | } // namespace sentencepiece |
nothing calls this directly
no test coverage detected