mirror of
https://github.com/browsermt/bergamot-translator.git
synced 2024-09-11 05:35:33 +03:00
Make default throw exception on abort for python (#333)
This also allows conversion of exiting aborts into runtime errors in python, providing informative messages to the user via pybind11 existing tooling.
This commit is contained in:
parent
b1e5a48f1a
commit
97bd6e36db
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user