File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
notebooks/document-chunking Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change 71
71
},
72
72
{
73
73
"cell_type" : " code" ,
74
- "execution_count" : 30 ,
74
+ "execution_count" : null ,
75
75
"id" : " f38e0397" ,
76
76
"metadata" : {
77
77
"colab" : {
80
80
"id" : " f38e0397" ,
81
81
"outputId" : " ad6df489-d242-4229-a42a-39c5ca19d124"
82
82
},
83
- "outputs" : [
84
- {
85
- "name" : " stdin" ,
86
- "output_type" : " stream" ,
87
- "text" : [
88
- " Elastic Cloud ID: ········\n " ,
89
- " Elastic Api Key: ········\n "
90
- ]
91
- }
92
- ],
83
+ "outputs" : [],
93
84
"source" : [
94
85
" from elasticsearch import Elasticsearch\n " ,
95
86
" from getpass import getpass\n " ,
170
161
" --hub-model-id \" sentence-transformers/all-MiniLM-L6-v2\" \\\n " ,
171
162
" --task-type text_embedding \\\n " ,
172
163
" --clear-previous \\\n " ,
173
- " --start"
164
+ " --start\n " ,
165
+ " \n " ,
166
+ " while True:\n " ,
167
+ " status = client.ml.get_trained_models_stats(model_id=MODEL_ID)\n " ,
168
+ " if \" trained_model_stats\" in status.keys() and status[\" trained_model_stats\" ][0][\" deployment_stats\" ][\" state\" ] == \" started\" :\n " ,
169
+ " print(MODEL_ID + \" Model has been successfully deployed & started.\" )\n " ,
170
+ " break\n " ,
171
+ " else:\n " ,
172
+ " print(MODEL_ID + \" Model is currently being deployed.\" )\n " ,
173
+ " time.sleep(5)\n "
174
174
]
175
175
},
176
176
{
300
300
"source" : [
301
301
" INDEX_NAME = \" chunk_passages_example\"\n " ,
302
302
" \n " ,
303
+ " client.indices.delete(index=INDEX_NAME, ignore_unavailable=True)\n " ,
304
+ " \n " ,
303
305
" # Setup the index\n " ,
304
306
" client.indices.create(\n " ,
305
307
" index=INDEX_NAME,\n " ,
You can’t perform that action at this time.
0 commit comments