Revert "Revert "Make default throw exception on abort for python (#333)""

This reverts commit 62ff781ed4.

Sorry I should have realized Jerin was only amending python and
therefore this didn't break WASM.

Apologies to Jerin on this.
This commit is contained in:
Kenneth Heafield 2022-02-07 14:21:48 +00:00
parent 62ff781ed4
commit f6d9233dc4

View File

@ -33,7 +33,10 @@ PYBIND11_MAKE_OPAQUE(Alignments);
class ServicePyAdapter {
public:
ServicePyAdapter(const Service::Config &config) : service_(make_service(config)) {}
ServicePyAdapter(const Service::Config &config) : service_(make_service(config)) {
// Set marian to throw exceptions instead of std::abort()
marian::setThrowExceptionOnAbort(true);
}
std::shared_ptr<_Model> modelFromConfig(const std::string &config) {
auto parsedConfig = marian::bergamot::parseOptionsFromString(config);