From 590eabb1800eb609505439222942425e0082f13a Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Mon, 2 Dec 2024 09:02:33 +0800 Subject: [PATCH] fix: calculate readme file path from build ctx rather than cwd (#5106) * fix: calculate readme file path from build ctx rather than cwd Signed-off-by: Frost Ming --- src/bentoml/_internal/bento/bento.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bentoml/_internal/bento/bento.py b/src/bentoml/_internal/bento/bento.py index 82b88091550..4adef598f96 100644 --- a/src/bentoml/_internal/bento/bento.py +++ b/src/bentoml/_internal/bento/bento.py @@ -366,13 +366,17 @@ def append_model(model: BentoModelInfo) -> None: if not ctx_fs.exists(file_name): raise InvalidArgument(f"File {file_name} does not exist.") copy_file_to_fs_folder( - file_name, bento_fs, dst_filename=BENTO_README_FILENAME + ctx_fs.getsyspath(file_name), + bento_fs, + dst_filename=BENTO_README_FILENAME, ) elif build_config.description is None and ctx_fs.exists( BENTO_README_FILENAME ): copy_file_to_fs_folder( - BENTO_README_FILENAME, bento_fs, dst_filename=BENTO_README_FILENAME + ctx_fs.getsyspath(BENTO_README_FILENAME), + bento_fs, + dst_filename=BENTO_README_FILENAME, ) else: with bento_fs.open(BENTO_README_FILENAME, "w") as f: