Open
Description
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},
)
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")
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")
Metadata
Metadata
Assignees
Labels
No labels