Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Inner array validation #9

Open
nxexox opened this issue Oct 18, 2023 · 0 comments
Open

[Feature] Inner array validation #9

nxexox opened this issue Oct 18, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@nxexox
Copy link
Owner

nxexox commented Oct 18, 2023

Problem

My model accepts strictly an array of 32 numbers. But you can send any number of numbers in a request, and then the model behaves incorrectly.

Solution

You need to add a validator to the web component, the length of the incoming array. The validator should be optional. Add the ability to configure the input array length validator in the web component settings and configuration files.

Examples

import mlup
from mlup.ml.empty import EmptyModel

up = mlup.UP(
    ml_model=EmptyModel(), 
    config=mlup.Config(
        min_length_inner_model_array=5,   # Optional
        max_length_inner_model_array=10,  # Optional
    )
)
@nxexox nxexox added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant