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

[BUG] ML inference processor error in foreach processor #2473

Closed
ylwu-amzn opened this issue May 25, 2024 · 0 comments · Fixed by #2474
Closed

[BUG] ML inference processor error in foreach processor #2473

ylwu-amzn opened this issue May 25, 2024 · 0 comments · Fixed by #2474
Assignees
Labels
bug Something isn't working

Comments

@ylwu-amzn
Copy link
Collaborator

ylwu-amzn commented May 25, 2024

What is the bug?
Run ML inference processor in foreach processor , and see errors.

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Create bedrock embedding model, model id 1Fn9rI8BcrAWgSPyeLjY
  2. Create ingest pipeline
PUT _ingest/pipeline/test_pipeline
{
  "description": "test embeddings",
  "processors": [
    {
      "foreach": {
        "field": "books",
        "processor": {
          "ml_inference": {
            "model_id": "1Fn9rI8BcrAWgSPyeLjY",
            "input_map": [
              {
                "input": "_ingest._value.title"
              }
            ],
            "output_map": [
              {
                "_ingest._value.title_embedding": "$.embedding"
              }
            ],
            "ignore_missing": true,
            "ignore_failure": false
          }
        }
      }
    }
  ]
}
  1. Run pipeline and see error
{
  "docs": [
    {
      "error": {
        "root_cause": [
          {
            "type": "runtime_exception",
            "reason": "the prediction field: $.embedding is an array in size of 1536 but the document field array from field _ingest._value.title_embedding is in size of 0"
          }
        ],
        "type": "runtime_exception",
        "reason": "the prediction field: $.embedding is an array in size of 1536 but the document field array from field _ingest._value.title_embedding is in size of 0"
      }
    }
  ]
}

What is the expected behavior?
It should generate embedding and generate such result

{
    "books": [{
        "title": "first book",
        "title_embedding": [
            -1.1015625,
            0.65234375,
            0.7578125
            ...
        ],
        "description": "This is first book"
    }]
}

What is your host/environment?

  • OS: [e.g. iOS]
  • Version [e.g. 22]
  • Plugins

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?
Add any other context about the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant