Skip to content

Upload Handler

Exitare edited this page Aug 5, 2022 · 2 revisions

The upload handler provides functionality to upload files (artifacts) to the mlflow tracking server.
To create an instance of an upload handler:

upload_handler: UploadHandler = UploadHandler(save_path)

The save path is required, because mlflow cannot upload files directly from memory. If the provided path does not exist, the handler will create the path for you.

Upload dataframe

Uploads a pandas dataframe or pandas series. It does all the lifting, e.g. writing the files to the hard drive, uploading it to mlflow.

Use remove index, to remove the index from the dataframe, when writing it to the disk. Specify the mlflow folder to create a folder structure inside of your mlflow run.

upload_handler.upload_dataframe(self, data: Union[pd.DataFrame, pd.Series], file_name: str, mlflow_folder: str = None,
                         remove_index: bool = True)

Upload file

If you just want to upload a file from your hard drive, use this function. The file name refers to the file which will be uploaded.
mlflow_folder refers again to a folder inside the mlflow artifact store.

upload_handler.upload_file(self, file_name: str, mlflow_folder: str = None):
Clone this wiki locally