|
| 1 | +""" |
| 2 | + settag(mlf::MLFlow, run, key, value) |
| 3 | + settag(mlf::MLFlow, run, kv) |
| 4 | +
|
| 5 | +Associates a tag (a key and a value) to the particular run. |
| 6 | +
|
| 7 | +Refer to [the official MLflow REST API |
| 8 | +docs](https://mlflow.org/docs/latest/rest-api.html#set-tag) for restrictions on |
| 9 | +`key` and `value`. |
| 10 | +
|
| 11 | +# Arguments |
| 12 | +- `mlf`: [`MLFlow`](@ref) configuration. |
| 13 | +- `run`: one of [`MLFlowRun`](@ref), [`MLFlowRunInfo`](@ref), or `String`. |
| 14 | +- `key`: tag key (name). Automatically converted to string before sending to MLFlow because this is the only type that MLFlow supports. |
| 15 | +- `value`: parameter value. Automatically converted to string before sending to MLFlow because this is the only type that MLFlow supports. |
| 16 | +
|
| 17 | +One could also specify `kv::Dict` instead of separate `key` and `value` arguments. |
| 18 | +""" |
| 19 | +function settag(mlf::MLFlow, run_id::String, key, value) |
| 20 | + endpoint ="runs/set-tag" |
| 21 | + mlfpost(mlf, endpoint; run_id=run_id, key=string(key), value=string(value)) |
| 22 | +end |
| 23 | +settag(mlf::MLFlow, run_info::MLFlowRunInfo, key, value) = |
| 24 | + settag(mlf, run_info.run_id, key, value) |
| 25 | +settag(mlf::MLFlow, run::MLFlowRun, key, value) = |
| 26 | + settag(mlf, run.info, key, value) |
| 27 | +function settag(mlf::MLFlow, run::Union{String,MLFlowRun,MLFlowRunInfo}, kv) |
| 28 | + for (k, v) in kv |
| 29 | + logparam(mlf, run, k, v) |
| 30 | + end |
| 31 | +end |
| 32 | + |
| 33 | + |
1 | 34 | """
|
2 | 35 | logparam(mlf::MLFlow, run, key, value)
|
3 | 36 | logparam(mlf::MLFlow, run, kv)
|
|
0 commit comments