ai4os / DEEPaaS

A REST API to serve machine learning and deep learning models
https://deepaas.readthedocs.io
Apache License 2.0
35 stars 15 forks source link

fix parsers overwrite #62

Closed IgnacioHeredia closed 5 years ago

IgnacioHeredia commented 5 years ago

Description

This is a fix to make the argument's parsers (both train and test) members of their respective classes.

The bug arises when several modules are present at the same time. If the parsers are not members of their class, they are are overwritten by the parser of the last loaded module due to the for loop structure of the module loading.

The bug was hard to find because it was only noticeable once the method was called: that is, the parameters for each module where correctly displayed in the API interface (with @api.expect()) but the parsing was done on the overwritten parser (args = parser.parse_args()).

Type of change

Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Tested for both train and predict methods with three different modules simultaneously installed.