Skip to content

Commit c8ffb58

Browse files
fix: description/readme too large (#5420)
* fix: description/readme too large * ci: auto fixes from pre-commit.ci For more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent a6781f8 commit c8ffb58

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bentoml/_internal/bento/bento.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,15 @@ def doc(self) -> str:
580580
return self._doc
581581
if not self._fs.isfile(BENTO_README_FILENAME):
582582
return ""
583+
info = self._fs.getinfo(BENTO_README_FILENAME, ["details"])
584+
if (
585+
info.size > 3 * 1024 * 1024
586+
): # 3MB, Limit of bentocloud api is 4MB, leave 1MB for other metadata
587+
logger.warning(
588+
"Bento README is too large (%d bytes > 3MB), skipping upload...",
589+
info.size,
590+
)
591+
return ""
583592
with self._fs.open(BENTO_README_FILENAME, "r") as readme_md:
584593
self._doc = str(readme_md.read())
585594
return self._doc

0 commit comments

Comments
 (0)