diff --git a/mlem/contrib/docker/context.py b/mlem/contrib/docker/context.py index 0058ad30..185bf98c 100644 --- a/mlem/contrib/docker/context.py +++ b/mlem/contrib/docker/context.py @@ -398,6 +398,8 @@ def write_local_sources(self, requirements: Requirements): logger.debug('Putting model source "%s" to distribution...', path) full_path = posixpath.join(self.path, path) self.fs.makedirs(posixpath.dirname(full_path), exist_ok=True) + if isinstance(src, str): # type: ignore + src = src.encode() # type: ignore with self.fs.open(full_path, "wb") as f: f.write(src)