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

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

Open
liu-xiao-guo opened this issue Jul 19, 2024 · 1 comment

Comments

@liu-xiao-guo
Copy link

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

@joemcelroy
Copy link
Member

We should be creating the inference services (https://www.elastic.co/guide/en/elasticsearch/reference/current/put-inference-api.html) under those names. Behind the scenes it will deploy ELSER or e5 model if not available automatically. Im unsure why it failed to create an inference deployment. Could you try again and see the error for deploying my-e5-model or my-elser-model.

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants