Skip to content

Commit d2f6838

Browse files
authored
update notebook + version update (opensearch-project#76)
* update notebook + version update Signed-off-by: Dhrubo Saha <[email protected]> * updated docs Signed-off-by: Dhrubo Saha <[email protected]> --------- Signed-off-by: Dhrubo Saha <[email protected]>
1 parent cd41a44 commit d2f6838

9 files changed

+49
-21
lines changed

docs/source/examples/demo_tracing_model_torchscript_onnx.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,4 +546,4 @@
546546
},
547547
"nbformat": 4,
548548
"nbformat_minor": 5
549-
}
549+
}

docs/source/examples/demo_transformer_model_train_save_upload_to_openSearch.ipynb

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,31 @@
5858
},
5959
{
6060
"cell_type": "code",
61-
"execution_count": null,
61+
"execution_count": 3,
62+
"id": "e239ffc9",
63+
"metadata": {},
64+
"outputs": [
65+
{
66+
"data": {
67+
"text/plain": [
68+
"('generate.py', <http.client.HTTPMessage at 0x10bdbe940>)"
69+
]
70+
},
71+
"execution_count": 3,
72+
"metadata": {},
73+
"output_type": "execute_result"
74+
}
75+
],
76+
"source": [
77+
"# Download generate.py for Generate Synthetic Queries\n",
78+
"\n",
79+
"import urllib.request\n",
80+
"urllib.request.urlretrieve(\"https://artifacts.opensearch.org/models/ml-models/huggingface/sentence-transformers/msmarco-distilbert-base-tas-b/1.0.0/onnx/config.json\", \"generate.py\")"
81+
]
82+
},
83+
{
84+
"cell_type": "code",
85+
"execution_count": 11,
6286
"id": "17a3e085",
6387
"metadata": {
6488
"scrolled": true
@@ -70,7 +94,7 @@
7094
},
7195
{
7296
"cell_type": "code",
73-
"execution_count": 1,
97+
"execution_count": 4,
7498
"id": "87c021df",
7599
"metadata": {},
76100
"outputs": [],
@@ -93,7 +117,7 @@
93117
},
94118
{
95119
"cell_type": "code",
96-
"execution_count": 4,
120+
"execution_count": 5,
97121
"id": "798cac25",
98122
"metadata": {},
99123
"outputs": [],
@@ -104,7 +128,7 @@
104128
},
105129
{
106130
"cell_type": "code",
107-
"execution_count": 5,
131+
"execution_count": 6,
108132
"id": "5c85ae17",
109133
"metadata": {},
110134
"outputs": [],
@@ -114,7 +138,7 @@
114138
},
115139
{
116140
"cell_type": "code",
117-
"execution_count": 6,
141+
"execution_count": 7,
118142
"id": "77442abf",
119143
"metadata": {},
120144
"outputs": [],
@@ -137,7 +161,7 @@
137161
},
138162
{
139163
"cell_type": "code",
140-
"execution_count": 7,
164+
"execution_count": 8,
141165
"id": "89e1cb2a",
142166
"metadata": {},
143167
"outputs": [],
@@ -147,7 +171,7 @@
147171
},
148172
{
149173
"cell_type": "code",
150-
"execution_count": 8,
174+
"execution_count": 9,
151175
"id": "9bc33a2d",
152176
"metadata": {},
153177
"outputs": [],
@@ -519,4 +543,4 @@
519543
},
520544
"nbformat": 4,
521545
"nbformat_minor": 5
522-
}
546+
}

docs/source/examples/online_retail_analysis.ipynb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
"name": "#%% md\n"
88
}
99
},
10-
"source": []
10+
"source": [
11+
"# Demo Notebook for Online Retail Analysis\n",
12+
"\n",
13+
"#### [download notebook](https://github.com/opensearch-project/opensearch-py-ml/blob/main/docs/source/examples/online_retail_analysis.ipynb)"
14+
]
1115
},
1216
{
1317
"cell_type": "markdown",
@@ -1702,4 +1706,4 @@
17021706
},
17031707
"nbformat": 4,
17041708
"nbformat_minor": 2
1705-
}
1709+
}

docs/source/reference/api/sentence_transformer.load_sentence_transformer_example.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SentenceTransformerModel.load_training_data
2+
==============================================
3+
4+
.. currentmodule:: opensearch_py_ml
5+
6+
.. autofunction:: opensearch_py_ml.ml_models.SentenceTransformerModel.load_training_data

docs/source/reference/api/sentence_transformer.save_as_onnx.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SentenceTransformerModel.save_as_onnx
2-
===================================
2+
=======================================
33

44
.. currentmodule:: opensearch_py_ml
55

docs/source/reference/sentencetransformer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Train Model
2525
:maxdepth: 2
2626

2727
api/sentence_transformer.read_queries
28-
api/sentence_transformer.load_sentence_transformer_example
28+
api/sentence_transformer.load_training_data
2929
api/sentence_transformer.set_up_accelerate_config
3030
api/sentence_transformer.train_model
3131
api/sentence_transformer.zip_model

opensearch_py_ml/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
__title__ = "opensearch_py_ml"
2828
__description__ = "Python Client and Toolkit for DataFrames, Big Data, Machine Learning and ETL in OpenSearch"
2929
__url__ = "https://github.com/opensearch-project/opensearch-py-ml"
30-
__version__ = "1.0.0b1"
30+
__version__ = "1.0.0"
3131
__author__ = "Dhrubo Saha"
3232
__author_email__ = "[email protected], "
3333
__maintainer__ = "Dhrubo Saha, Yaliang Wu"

opensearch_py_ml/ml_models/sentencetransformermodel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ def train_model(
469469
num_training_steps=num_epochs * len(train_dataloader),
470470
)
471471

472-
accelerator = Accelerator(fp16=training_args.fp16)
472+
accelerator = Accelerator()
473473
model, optimizer, train_dataloader, scheduler = accelerator.prepare(
474474
model, optimizer, train_dataloader, scheduler
475475
)

0 commit comments

Comments
 (0)