react-code-dataset / next.js /test /e2e /app-dir /actions /account-for-overhead.js
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame
353 Bytes
/**
* This function accounts for the overhead of encoding the data to be sent
* over the network via a multipart request.
*
* @param {number} megaBytes
* @returns {number}
*/
export function accountForOverhead(megaBytes) {
// We are sending {megaBytes} - 5% to account for encoding overhead
return Math.floor(1024 * 1024 * megaBytes * 0.95)
}