add_files
Adds files to a running deployment. Calling this function will redeploy the deployment after adding the files. This method is useful when changing a settings file stored in a deployment. For updating models and other binary data, the model registry a better solution.
Parameters
mb.add_files(deployment=, files=)
deployment
:str
The name of the deployment to add the file to.file_list
:Union[str, List[str], Dict[str, str]]
: The files to add to the deployment.- as
str
: The path to a single file or directory. - as
List[str]
: Paths to multiple files or directories. - as
Dict[str, str]
: Pairs of file paths or directories. The key is the local file path, the value is the file path in common files.
- as
Examples
Adding local files to a deployment
When the local files have the same relative path as in the deployment, can add them by listing their paths:
mb.add_files("deployment_name", ["file1.pkl", "file2.pkl"])
Using different local vs. deployment filepaths
If the local filepaths and deployment filepaths are different, add the files using the dict
syntax:
mb.add_files(my_deployment, { "/trained_models/updated_model.pkl": "updated_model.pkl" })