You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the feature
Support returning the main function of 'train', and 'test' scripts like mim.train(return_function=True)(args).
Motivation
Currently, mim.train and mim.test works as running the script as a subprocess.
In addition to this, if it can work as returning the main function of these scripts,
it would be nice for third-party frameworks to utilize these scripts in runtime.
For example, our work had to copy-and-paste train scripts to utilize these as function.
Although it can be done in other libraries, it seems safer to be supported by mim.
In addition to this, like our example in the above link, it would be helpful to be able to give custom args in parse_args(args) in the scripts to customize its functionality.
Although it affects many other frameworks and packages, I think it would benefit other frameworks in the future! :)
The text was updated successfully, but these errors were encountered:
nijkah
changed the title
[Feature Request] Support returning the main function of 'train', and 'test` scripts
[Feature Request] Support returning the main function of 'train', and 'test' scripts
Dec 19, 2022
Firstly, thanks for your kind advice about this feature request! 🥰
After an internal discussion, we gave our opinion on this feature request. We may not plan to support this feature in MIM, but could provide an API that returns the path to the train and test scripts.
Here are some of the reasons:
It's simple to implement the ability to return a function via a given python file, and you've given examples. The important thing is to get the exact train and test script paths. So we think it makes sense to provide this API.
The mim train and mim test commands are mainly used to parse command arguments and launch distributed. We tend not to put in other features that would make the code more difficult to maintain.
These are some of our thoughts. If you agree with the above solution, we will create a PR to add an API that returns the path to the train and test scripts.
If you have any other comments, please let us know. Feedback from the community is very important to us!
Describe the feature
Support returning the main function of 'train', and 'test' scripts like
mim.train(return_function=True)(args)
.Motivation
Currently,
mim.train
andmim.test
works as running the script as a subprocess.In addition to this, if it can work as returning the
main
function of these scripts,it would be nice for third-party frameworks to utilize these scripts in runtime.
For example, our work had to copy-and-paste
train
scripts to utilize these as function.One of the possible ways to support this feature is described in https://stackoverflow.com/a/67692.
Although it can be done in other libraries, it seems safer to be supported by
mim
.In addition to this, like our example in the above link, it would be helpful to be able to give custom
args
inparse_args(args)
in the scripts to customize its functionality.Although it affects many other frameworks and packages, I think it would benefit other frameworks in the future! :)
The text was updated successfully, but these errors were encountered: