langchain_community.callbacks.mlflow_callback
.MlflowLogger¶
- class langchain_community.callbacks.mlflow_callback.MlflowLogger(**kwargs: Any)[source]¶
Callback Handler that logs metrics and artifacts to mlflow server.
- Parameters
name (str) – Name of the run.
experiment (str) – Name of the experiment.
tags (dict) – Tags to be attached for the run.
tracking_uri (str) – MLflow tracking server uri.
This handler implements the helper functions to initialize, log metrics and artifacts to the mlflow server.
Methods
__init__
(**kwargs)artifact
(path)To upload the file from given path as artifact.
To finish the run.
html
(html, filename)To log the input html string as html file artifact.
jsonf
(data, filename)To log the input data as json file artifact.
langchain_artifact
(chain)metric
(key, value)To log metric to mlflow server.
metrics
(data[, step])To log all metrics in the input dict.
start_run
(name, tags)To start a new run, auto generates the random suffix for name
table
(name, dataframe)To log the input pandas dataframe as a html table
text
(text, filename)To log the input text as text file artifact.
- jsonf(data: Dict[str, Any], filename: str) None [source]¶
To log the input data as json file artifact.
- metrics(data: Union[Dict[str, float], Dict[str, int]], step: Optional[int] = 0) None [source]¶
To log all metrics in the input dict.