label-studio-ml-backend icon indicating copy to clipboard operation
label-studio-ml-backend copied to clipboard

custom arguments in backend

Open fsam6177 opened this issue 3 years ago • 1 comments

Hello, I want to add a custom argument to the init function. But couldn't find instructions on how to pass the argument in the instantiation of the model. Here is the code which has the basic init shown and custom argument.

` class RNN_Model(LabelStudioMLBase):

def __init__(self, arg_1 = None,**kwargs):

`

Could someone point me to the instantiation of the model where I can pass custom arguments?

fsam6177 avatar Aug 21 '22 21:08 fsam6177

Hi @fsam6177 You can start your ML backend with --with keyword and params like arg_1=your_value

KonstantinKorotaev avatar Aug 29 '22 08:08 KonstantinKorotaev

Hi @KonstantinKorotaev , I have a similar problem. I added some custom parameters to the fit function, but I don't know how to pass these custom parameters in the fit function when I click on the start training button. Any suggestions? Thank you very much!

chenshen03 avatar Dec 01 '22 04:12 chenshen03

Hi @chenshen03

You add custom param by starting your ML backend with --with keyword and params like arg_1=your_value.

If you ask about adding params from Label Studio UI - there is no such option right now, but I will create a feature request for it.

KonstantinKorotaev avatar Dec 08 '22 19:12 KonstantinKorotaev