Skip to content

Commit

Permalink
fix: calculate readme file path from build ctx rather than cwd (#5106)
Browse files Browse the repository at this point in the history
* fix: calculate readme file path from build ctx rather than cwd

Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming authored Dec 2, 2024
1 parent b8f5072 commit 590eabb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/bentoml/_internal/bento/bento.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 590eabb

Please sign in to comment.