| 345 | } |
| 346 | |
| 347 | TFullModel ReadModelAny(const TString& fileName) { |
| 348 | TFullModel model; |
| 349 | bool loaded = false; |
| 350 | for (EModelType modelType : {EModelType::CatboostBinary, EModelType::AppleCoreML}) { |
| 351 | try { |
| 352 | model = ReadModel(fileName, modelType); |
| 353 | } catch (TCatBoostException& e) { |
| 354 | continue; |
| 355 | } |
| 356 | loaded = true; |
| 357 | break; |
| 358 | } |
| 359 | CB_ENSURE(loaded, "Cannot load model " << fileName); |
| 360 | return model; |
| 361 | } |
| 362 | |
| 363 | // returns Nothing() if both lhs and rhs are not of TModel type |
| 364 | template <class TModel> |