-
Notifications
You must be signed in to change notification settings - Fork 167
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
Semantic text notebook #271
Conversation
Found 1 changed notebook. Review the changes at https://gitnotebooks.com/elastic/elasticsearch-labs/pull/271 |
"source": [ | ||
"# Semantic Search with Semantic Text\n", | ||
"\n", | ||
"<a target=\"_blank\" href=\"https://colab.research.google.com/github/Mikep86/elasticsearch-labs/blob/semantic-text-notebook/notebooks/search/09-semantic-text.ipynb\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix this link before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 - some minor comments
@Mikep86 To prevent this notebook for running (and failing) in 8.14 and older CI runs, add a |
"while True:\n", | ||
" status = client.ml.get_trained_models_stats(\n", | ||
" model_id=model_id,\n", | ||
" )\n", | ||
"\n", | ||
" deployment_stats = status[\"trained_model_stats\"][0].get(\"deployment_stats\")\n", | ||
" if deployment_stats is None:\n", | ||
" print(\"ELSER Model is currently being deployed.\")\n", | ||
" continue\n", | ||
"\n", | ||
" nodes = deployment_stats.get(\"nodes\")\n", | ||
" if nodes is not None and len(nodes) > 0:\n", | ||
" print(\"ELSER Model has been successfully deployed.\")\n", | ||
" break\n", | ||
" else:\n", | ||
" print(\"ELSER Model is currently being deployed.\")\n", | ||
" time.sleep(5)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joemcelroy I used the ELSER notebook as a guide for this code and modified it to work with inference endpoints. However, I found two issues when doing so:
- The notebook CI currently doesn't check against a serverless environment
- The status check used in the ELSER notebook breaks when run against a serverless environment.
trained_model_stats.0.deployment_stats.state
doesn't exist in the serverless response toclient.ml.get_trained_models_stats
. Instead, I checked if thenodes
list is populated, which seems to work in both hosted & serverless environments.
@miguelgrinberg Seems like CI is broken on the |
Adds a search notebook demonstrating basic, end-to-end usage of the
semantic_text
field type