Skip to content

'No known model deployment with id [my-elser-model]' in "retrievers_intro_notebook" #295

Open
@liu-xiao-guo

Description

@liu-xiao-guo

I had a local setup using Elastic Stack 8.14. I tried to run the notebook at https://github.com/elastic/elasticsearch-labs/blob/main/supporting-blog-content/introducing-retrievers/retrievers_intro_notebook.ipynb with some modification to make it work with my local setup.

I have an error with the following code:

for model_id in ["my-elser-model","my-e5-model"]:
    result = es.perform_request(
        "POST",
        f"/_ml/trained_models/{model_id}/deployment/_update",
        headers={"content-type": "application/json", "accept": "application/json"},
        body={"number_of_allocations": 1},
    )

image

However, I do not have error with the following code:

for model_id in [".elser_model_2","my-e5-model"]:
    result = es.perform_request(
        "POST",
        f"/_ml/trained_models/{model_id}/deployment/_update",
        headers={"content-type": "application/json", "accept": "application/json"},
        body={"number_of_allocations": 1},
    )

Please be noted that I did not install the linux_x6 version since I ran it on my macOS computer.

In addition, the following code:

response = es.search(
    index="imdb_movies",
    body={
        "retriever": {
            "standard": {
                "query": {
                    "text_expansion": {
                        "overview_sparse": {
                            "model_id": "my-elser-model",
                            "model_text": movie_search,
                        }
                    }
                }
            }
        },
        "size": 3,
        "fields": ["names", "overview"],
        "_source": False,
    },
)

for hit in response["hits"]["hits"]:
    print(f"{hit['fields']['names'][0]}\n- {hit['fields']['overview'][0]}\n")

It gave me the error like:
image

However, the following code does not give me any error:

response = es.search(
    index="imdb_movies",
    body={
        "retriever": {
            "standard": {
                "query": {
                    "text_expansion": {
                        "overview_sparse": {
                            "model_id": ".elser_model_2",
                            "model_text": movie_search,
                        }
                    }
                }
            }
        },
        "size": 3,
        "fields": ["names", "overview"],
        "_source": False,
    },
)

for hit in response["hits"]["hits"]:
    print(f"{hit['fields']['names'][0]}\n- {hit['fields']['overview'][0]}\n")

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions