[ML] Round value when using max model memory limit (#35223)

* [ML] Round value when using max model memory limit

* changing ceil to floor to avoid accidentally exceeding max mml
This commit is contained in:
James Gowdy 2019-04-17 16:00:35 +01:00 committed by GitHub
parent e05098dd27
commit c0edcbe9ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,7 +105,7 @@ export function calculateModelMemoryLimitProvider(callWithRequest) {
const maxBytes = numeral(limits.max_model_memory_limit.toUpperCase()).value();
const mmlBytes = numeral(`${mmlMB}MB`).value();
if (mmlBytes > maxBytes) {
mmlMB = (maxBytes / numeral('1MB').value());
mmlMB = Math.floor(maxBytes / numeral('1MB').value());
}
}
response({ modelMemoryLimit: `${mmlMB}MB` });