pymlup icon indicating copy to clipboard operation
pymlup copied to clipboard

[Feature] Make it more convenient to work with dictionary type parameters in bash commands

Open nxexox opened this issue 2 years ago • 0 comments
trafficstars

Problem

When I use bash commands and want to specify additional dictionary type configuration options, I need to specify the entire dictionary with escape.

mlup run -m model.onnx --up.uvicorn_kwargs='{"workers": 4, "timeout_graceful_shutdown": 10}'

Solution

Add the ability to specify dictionary keys for each key separately.

mlup run -m model.onnx --up.uvicorn_kwargs.workers=4 --up.uvicorn_kwargs.timeout_graceful_shutdown=10

But you need to leave the current format for installing the parameter dictionary. The parameters must be applied sequentially - first the entire dictionary, and then the point parameters in it will be replaced.

mlup run -m model.onnx --up.uvicorn_kwargs.workers=2 --up.uvicorn_kwargs='{"workers": 4, "timeout_graceful_shutdown": 10}'

В итоге словарь uvicorn_kwargs будет иметь вид: {"workers": 2, "timeout_graceful_shutdown": 10}.

Dictionary type parameters:

  • mlup.ml.conf.storage_kwargs
  • mlup.web.conf.uvicorn_kwargs

nxexox avatar Oct 18 '23 13:10 nxexox