2

When using Inference Schema to autogenerate the swagger doc for my AzureML endpoint (as detailed here and here), I see that it creates a wrapper around my input_sample. Is there a way to not wrap the input inside this "data" wrapper?

Here is what my score.py looks like:

input_sample = {
                "id": 123,
                "language": "en"
                "items": [{
                    "item": 1,
                    "desc": "desc"
                }]
            }
output_sample = [{'prediction': 'true', 'predictionConfidence': 0.8279970776764844}]

@input_schema('data', StandardPythonParameterType(input_sample))
@output_schema(StandardPythonParameterType(output_sample))
def run(data):
"""
    {
        data: { --> DON'T WANT this "data" wrapper
                "id": 123,
                "language": "en"
                "items": [{
                    "item": 1,
                    "desc": "desc"
                }]
            }
    }
    """
    try:
        id = data['id']
        ...
        
pyron_orion
  • 545
  • 5
  • 18
  • do you want to customise the swagger json file associated to the API of the deployed model.? – Ram Oct 05 '20 at 08:02

1 Answers1

0

InferenceSchema used with Azure Machine Learning deployments, then the code for this package was recently published at https://github.com/Azure/InferenceSchema under an MIT license. So you could possibly use that to create a version specific to your needs.

Ram
  • 2,459
  • 1
  • 7
  • 14