strickvl commited on
Commit
87d67d4
1 Parent(s): 8fefe12

Add new SentenceTransformer model.

Browse files
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 768,
3
+ "pooling_mode_cls_token": true,
4
+ "pooling_mode_mean_tokens": false,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,1618 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: Snowflake/snowflake-arctic-embed-m
3
+ datasets: []
4
+ language:
5
+ - en
6
+ library_name: sentence-transformers
7
+ license: apache-2.0
8
+ metrics:
9
+ - cosine_accuracy@1
10
+ - cosine_accuracy@3
11
+ - cosine_accuracy@5
12
+ - cosine_accuracy@10
13
+ - cosine_precision@1
14
+ - cosine_precision@3
15
+ - cosine_precision@5
16
+ - cosine_precision@10
17
+ - cosine_recall@1
18
+ - cosine_recall@3
19
+ - cosine_recall@5
20
+ - cosine_recall@10
21
+ - cosine_ndcg@10
22
+ - cosine_mrr@10
23
+ - cosine_map@100
24
+ pipeline_tag: sentence-similarity
25
+ tags:
26
+ - sentence-transformers
27
+ - sentence-similarity
28
+ - feature-extraction
29
+ - generated_from_trainer
30
+ - dataset_size:1490
31
+ - loss:MatryoshkaLoss
32
+ - loss:MultipleNegativesRankingLoss
33
+ widget:
34
+ - source_sentence: How can I list the 'kubernetes-cluster' resources that are accessible
35
+ by service connectors in my ZenML workspace?
36
+ sentences:
37
+ - 'lly registered orchestrator `<ORCHESTRATOR_NAME>`.$ zenml service-connector list-resources
38
+ --resource-type kubernetes-cluster -e
39
+
40
+ The following ''kubernetes-cluster'' resources can be accessed by service connectors
41
+ configured in your workspace:
42
+
43
+ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━┓
44
+
45
+ ┃ CONNECTOR ID │ CONNECTOR NAME │ CONNECTOR TYPE
46
+ │ RESOURCE TYPE │ RESOURCE NAMES ┃
47
+
48
+ ┠──────────────────────────────────────┼───────────────────────┼────────────────┼───────────────────────┼─────────────────────┨
49
+
50
+ ┃ e33c9fac-5daa-48b2-87bb-0187d3782cde │ aws-iam-multi-eu │ 🔶 aws │
51
+ 🌀 kubernetes-cluster │ kubeflowmultitenant ┃
52
+
53
+ ┃ │ │ │ │
54
+ zenbox ┃
55
+
56
+ ┠──────────────────────────────────────┼───────────────────────┼────────────────┼───────────────────────┼─────────────────────┨
57
+
58
+ ┃ ed528d5a-d6cb-4fc4-bc52-c3d2d01643e5 │ aws-iam-multi-us │ 🔶 aws │
59
+ 🌀 kubernetes-cluster │ zenhacks-cluster ┃
60
+
61
+ ┠──────────────────────────────────────┼───────────────────────┼────────────────┼───────────────────────┼─────────────────────┨
62
+
63
+ ┃ 1c54b32a-4889-4417-abbd-42d3ace3d03a │ gcp-sa-multi │ 🔵 gcp │
64
+ 🌀 kubernetes-cluster │ zenml-test-cluster ┃
65
+
66
+ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━┛'
67
+ - 'Name your pipeline runs
68
+
69
+
70
+ In the output logs of a pipeline run you will see the name of the run:
71
+
72
+
73
+ Pipeline run training_pipeline-2023_05_24-12_41_04_576473 has finished in 3.742s.
74
+
75
+
76
+ This name is automatically generated based on the current date and time. To change
77
+ the name for a run, pass run_name as a parameter to the with_options() method:
78
+
79
+
80
+ training_pipeline = training_pipeline.with_options(
81
+
82
+
83
+ run_name="custom_pipeline_run_name"
84
+
85
+
86
+ training_pipeline()
87
+
88
+
89
+ Pipeline run names must be unique, so if you plan to run your pipelines multiple
90
+ times or run them on a schedule, make sure to either compute the run name dynamically
91
+ or include one of the following placeholders that ZenML will replace:
92
+
93
+
94
+ {{date}} will resolve to the current date, e.g. 2023_02_19
95
+
96
+
97
+ {{time}} will resolve to the current time, e.g. 11_07_09_326492
98
+
99
+
100
+ training_pipeline = training_pipeline.with_options(
101
+
102
+
103
+ run_name=f"custom_pipeline_run_name_{{date}}_{{time}}"
104
+
105
+
106
+ training_pipeline()
107
+
108
+
109
+ Be sure to include the f string prefix to allow for the placeholders to be replaced,
110
+ as shown in the example above. Without the f prefix, the placeholders will not
111
+ be replaced.
112
+
113
+
114
+ PreviousUsing a custom step invocation ID
115
+
116
+
117
+ NextUse failure/success hooks
118
+
119
+
120
+ Last updated 19 days ago'
121
+ - ' a_new_local_stack -o default -a my_artifact_storestack : This is the CLI group
122
+ that enables interactions with the stacks
123
+
124
+
125
+ register: Here we want to register a new stack. Explore other operations withzenml
126
+ stack --help.
127
+
128
+
129
+ a_new_local_stack : This is the unique name that the stack will have.
130
+
131
+
132
+ --orchestrator or -o are used to specify which orchestrator to use for the stack
133
+
134
+
135
+ --artifact-store or -a are used to specify which artifact store to use for the
136
+ stack
137
+
138
+
139
+ The output for the command should look something like this:
140
+
141
+
142
+ Using the default local database.
143
+
144
+
145
+ Running with active workspace: ''default'' (repository)
146
+
147
+
148
+ Stack ''a_new_local_stack'' successfully registered!
149
+
150
+
151
+ You can inspect the stack with the following command:
152
+
153
+
154
+ zenml stack describe a_new_local_stack
155
+
156
+
157
+ Which will give you an output like this:
158
+
159
+
160
+ Stack Configuration
161
+
162
+
163
+ ┏━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━┓
164
+
165
+
166
+ ┃ COMPONENT_TYPE │ COMPONENT_NAME ┃
167
+
168
+
169
+ ┠────────────────┼───────────────────┨
170
+
171
+
172
+ ┃ ORCHESTRATOR │ default ┃
173
+
174
+
175
+ ┠────────────────┼───────────────────┨
176
+
177
+
178
+ ┃ ARTIFACT_STORE │ my_artifact_store ┃
179
+
180
+
181
+ ┗━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━┛
182
+
183
+
184
+ ''a_new_local_stack'' stack
185
+
186
+
187
+ Stack ''a_new_local_stack'' with id ''...'' is owned by user default and is ''private''.
188
+
189
+
190
+ Switch stacks with our VS Code extension
191
+
192
+
193
+ If you are using our VS Code extension, you can easily view and switch your stacks
194
+ by opening the sidebar (click on the ZenML icon). You can then click on the stack
195
+ you want to switch to as well as view the stack components it''s made up of.
196
+
197
+
198
+ Run a pipeline on the new local stack
199
+
200
+
201
+ Let''s use the pipeline in our starter project from the previous guide to see
202
+ it in action.
203
+
204
+
205
+ If you have not already, clone the starter template:
206
+
207
+
208
+ pip install "zenml[templates,server]" notebook
209
+
210
+
211
+ zenml integration install sklearn -y
212
+
213
+
214
+ mkdir zenml_starter
215
+
216
+
217
+ cd zenml_starter
218
+
219
+
220
+ zenml init --template starter --template-with-defaults
221
+
222
+
223
+ # Just in case, we install the requirements again
224
+
225
+
226
+ pip install -r requirements.txt
227
+
228
+
229
+ The starter template is the same as the ZenML quickstart. You can clone it like
230
+ so:'
231
+ - source_sentence: How can I explicitly name my model version in ZenML?
232
+ sentences:
233
+ - 'strator supports specifying resources in what way.If you''re using an orchestrator
234
+ which does not support this feature or its underlying infrastructure does not
235
+ cover your requirements, you can also take a look at step operators which allow
236
+ you to execute individual steps of ../...your pipeline in environments independent
237
+ of your orchestrator.
238
+
239
+
240
+ Ensure your container is CUDA-enabled
241
+
242
+
243
+ To run steps or pipelines on GPUs, it''s crucial to have the necessary CUDA tools
244
+ installed in the environment. This section will guide you on how to configure
245
+ your environment to utilize GPU capabilities effectively.
246
+
247
+
248
+ Note that these configuration changes are required for the GPU hardware to be
249
+ properly utilized. If you don''t update the settings, your steps might run, but
250
+ they will not see any boost in performance from the custom hardware.
251
+
252
+
253
+ All steps running on GPU-backed hardware will be executed within a containerized
254
+ environment, whether you''re using the local Docker orchestrator or a cloud instance
255
+ of Kubeflow. Therefore, you need to make two amendments to your Docker settings
256
+ for the relevant steps:
257
+
258
+
259
+ 1. Specify a CUDA-enabled parent image in your DockerSettings
260
+
261
+
262
+ For complete details, refer to the containerization page that explains how to
263
+ do this. As an example, if you want to use the latest CUDA-enabled official PyTorch
264
+ image for your entire pipeline run, you can include the following code:
265
+
266
+
267
+ from zenml import pipeline
268
+
269
+
270
+ from zenml.config import DockerSettings
271
+
272
+
273
+ docker_settings = DockerSettings(parent_image="pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime")
274
+
275
+
276
+ @pipeline(settings={"docker": docker_settings})
277
+
278
+
279
+ def my_pipeline(...):
280
+
281
+
282
+ ...
283
+
284
+
285
+ For TensorFlow, you might use the tensorflow/tensorflow:latest-gpu image, as detailed
286
+ in the official TensorFlow documentation or their DockerHub overview.
287
+
288
+
289
+ 2. Add ZenML as an explicit pip requirement'
290
+ - 'Reuse Docker builds to speed up Docker build times
291
+
292
+
293
+ Avoid building Docker images each time a pipeline runs
294
+
295
+
296
+ When using containerized components in your stack, ZenML needs to build Docker
297
+ images to remotely execute your code. Building Docker images without connecting
298
+ a git repository includes your step code in the built Docker image. This, however,
299
+ means that new Docker images will be built and pushed whenever you make changes
300
+ to any of your source files.
301
+
302
+
303
+ One way of skipping Docker builds each time is to pass in the ID of a build as
304
+ you run the pipeline:
305
+
306
+
307
+ my_pipeline = my_pipeline.with_options(build=<BUILD_ID>)
308
+
309
+
310
+ or when running a pipeline from the CLI:
311
+
312
+
313
+ zenml pipeline run <PIPELINE_NAME> --build=<BUILD_ID>
314
+
315
+
316
+ Please note, that this means specifying a custom build when running a pipeline
317
+ will not run the code on your client machine but will use the code included in
318
+ the Docker images of the build. As a consequence, even if you make local code
319
+ changes, reusing a build will always execute the code bundled in the Docker image,
320
+ rather than the local code. Therefore, if you would like to reuse a Docker build
321
+ AND make sure your local code changes are also downloaded into the image, you
322
+ need to connect a git repository.
323
+
324
+
325
+ PreviousWhich files are built into the image
326
+
327
+
328
+ NextUse code repositories to automate Docker build reuse
329
+
330
+
331
+ Last updated 19 days ago'
332
+ - 'Controlling Model versions
333
+
334
+
335
+ Each model can have many versions. Model versions are a way for you to track different
336
+ iterations of your training process, complete with some extra dashboard and API
337
+ functionality to support the full ML lifecycle.
338
+
339
+
340
+ E.g. Based on your business rules during training, you can associate model version
341
+ with stages and promote them to production. You have an interface that allows
342
+ you to link these versions with non-technical artifacts and data, e.g. business
343
+ data, datasets, or even stages in your process and workflow.
344
+
345
+
346
+ Model versions are created implicitly as you are running your machine learning
347
+ training, so you don''t have to immediately think about this. If you want more
348
+ control over versions, our API has you covered, with an option to explicitly name
349
+ your versions.
350
+
351
+
352
+ Explicitly name your model version
353
+
354
+
355
+ If you want to explicitly name your model version, you can do so by passing in
356
+ the version argument to the Model object. If you don''t do this, ZenML will automatically
357
+ generate a version number for you.
358
+
359
+
360
+ from zenml import Model, step, pipeline
361
+
362
+
363
+ model= Model(
364
+
365
+
366
+ name="my_model",
367
+
368
+
369
+ version="1.0.5"
370
+
371
+
372
+ # The step configuration will take precedence over the pipeline
373
+
374
+
375
+ @step(model=model)
376
+
377
+
378
+ def svc_trainer(...) -> ...:
379
+
380
+
381
+ ...
382
+
383
+
384
+ # This configures it for all steps within the pipeline
385
+
386
+
387
+ @pipeline(model=model)
388
+
389
+
390
+ def training_pipeline( ... ):
391
+
392
+
393
+ # training happens here
394
+
395
+
396
+ Here we are specifically setting the model configuration for a particular step
397
+ or for the pipeline as a whole.
398
+
399
+
400
+ Please note in the above example if the model version exists, it is automatically
401
+ associated with the pipeline and becomes active in the pipeline context. Therefore,
402
+ a user should be careful and intentional as to whether you want to create a new
403
+ pipeline, or fetch an existing one. See below for an example of fetching a model
404
+ from an existing version/stage.
405
+
406
+
407
+ Fetching model versions by stage'
408
+ - source_sentence: What are the different roles available for users in an organization
409
+ within ZenML Pro?
410
+ sentences:
411
+ - 'User Management
412
+
413
+
414
+ In ZenML Pro, there is a slightly different entity hierarchy as compared to the
415
+ open-source ZenML framework. This document walks you through the key differences
416
+ and new concepts that are pro-only.
417
+
418
+
419
+ Organizations, Tenants, and Roles
420
+
421
+
422
+ ZenML Pro arranges various aspects of your work experience around the concept
423
+ of an Organization. This is the top-most level structure within the ZenML Cloud
424
+ environment. Generally, an organization contains a group of users and one or more
425
+ tenants. Tenants are individual, isolated deployments of the ZenML server.
426
+
427
+
428
+ Every user in an organization has a distinct role. Each role configures what they
429
+ can view, modify, and their level of involvement in collaborative tasks. A role
430
+ thus helps determine the level of access that a user has within an organization.
431
+
432
+
433
+ The admin has all permissions on an organization. They are allowed to add members,
434
+ adjust the billing information and assign roles. The editor can still fully manage
435
+ tenants and members but is not allowed to access the subscription information
436
+ or delete the organization. The viewer Role allows you to allow users to access
437
+ the tenants within the organization with only view permissions.
438
+
439
+
440
+ Inviting Team Members
441
+
442
+
443
+ Inviting users to your organization to work on the organization''s tenants is
444
+ easy. Simply click Add Member in the Organization settings, and give them an initial
445
+ Role. The User will be sent an invitation email. If a user is part of an organization,
446
+ they can utilize their login on all tenants they have authority to access.
447
+
448
+
449
+ PreviousZenML SaaS
450
+
451
+
452
+ NextStarter guide
453
+
454
+
455
+ Last updated 12 days ago'
456
+ - ' more information.
457
+
458
+
459
+ Get the last run of a pipelineTo access the most recent run of a pipeline, you
460
+ can either use the last_run property or access it through the runs list:
461
+
462
+
463
+ last_run = pipeline_model.last_run # OR: pipeline_model.runs[0]
464
+
465
+
466
+ If your most recent runs have failed, and you want to find the last run that has
467
+ succeeded, you can use the last_successful_run property instead.
468
+
469
+
470
+ Get the latest run from a pipeline
471
+
472
+
473
+ Calling a pipeline executes it and then returns the response of the freshly executed
474
+ run.
475
+
476
+
477
+ run = training_pipeline()
478
+
479
+
480
+ The run that you get back is the model stored in the ZenML database at the point
481
+ of the method call. This means the pipeline run is still initializing and no steps
482
+ have been run. To get the latest state can get a refreshed version from the client:
483
+
484
+
485
+ from zenml.client import Client
486
+
487
+
488
+ Client().get_pipeline_run(run.id) to get a refreshed version
489
+
490
+
491
+ Get a run via the client
492
+
493
+
494
+ If you already know the exact run that you want to fetch (e.g., from looking at
495
+ the dashboard), you can use the Client.get_pipeline_run() method to fetch the
496
+ run directly without having to query the pipeline first:
497
+
498
+
499
+ from zenml.client import Client
500
+
501
+
502
+ pipeline_run = Client().get_pipeline_run("first_pipeline-2023_06_20-16_20_13_274466")
503
+
504
+
505
+ Similar to pipelines, you can query runs by either ID, name, or name prefix, and
506
+ you can also discover runs through the Client or CLI via the Client.list_pipeline_runs()
507
+ or zenml pipeline runs list commands.
508
+
509
+
510
+ Run information
511
+
512
+
513
+ Each run has a collection of useful information which can help you reproduce your
514
+ runs. In the following, you can find a list of some of the most useful pipeline
515
+ run information, but there is much more available. See the PipelineRunResponse
516
+ definition for a comprehensive list.
517
+
518
+
519
+ Status
520
+
521
+
522
+ The status of a pipeline run. There are five possible states: initialized, failed,
523
+ completed, running, and cached.
524
+
525
+
526
+ status = run.status
527
+
528
+
529
+ Configuration'
530
+ - 'ner(gamma=gamma, X_train=X_train, y_train=y_train)if __name__ == "__main__":
531
+
532
+
533
+ first_pipeline()
534
+
535
+
536
+ python run.py
537
+
538
+
539
+ ...
540
+
541
+
542
+ Registered pipeline first_pipeline (version 2).
543
+
544
+
545
+ ...
546
+
547
+
548
+ This will now create a single run for version 2 of the pipeline called first_pipeline.
549
+
550
+
551
+ PreviousHyperparameter tuning
552
+
553
+
554
+ NextAccess secrets in a step
555
+
556
+
557
+ Last updated 15 days ago'
558
+ - source_sentence: How can I check which GCP Service Connectors can access a GCS bucket
559
+ in my ZenML deployment?
560
+ sentences:
561
+ - 'dashboard.
562
+
563
+
564
+ Warning! Usage in remote orchestratorsThe current ZenML version has a limitation
565
+ in its base Docker image that requires a workaround for all pipelines using Deepchecks
566
+ with a remote orchestrator (e.g. Kubeflow , Vertex). The limitation being that
567
+ the base Docker image needs to be extended to include binaries that are required
568
+ by opencv2, which is a package that Deepchecks requires.
569
+
570
+
571
+ While these binaries might be available on most operating systems out of the box
572
+ (and therefore not a problem with the default local orchestrator), we need to
573
+ tell ZenML to add them to the containerization step when running in remote settings.
574
+ Here is how:
575
+
576
+
577
+ First, create a file called deepchecks-zenml.Dockerfile and place it on the same
578
+ level as your runner script (commonly called run.py). The contents of the Dockerfile
579
+ are as follows:
580
+
581
+
582
+ ARG ZENML_VERSION=0.20.0
583
+
584
+
585
+ FROM zenmldocker/zenml:${ZENML_VERSION} AS base
586
+
587
+
588
+ RUN apt-get update
589
+
590
+
591
+ RUN apt-get install ffmpeg libsm6 libxext6 -y
592
+
593
+
594
+ Then, place the following snippet above your pipeline definition. Note that the
595
+ path of the dockerfile are relative to where the pipeline definition file is.
596
+ Read the containerization guide for more details:
597
+
598
+
599
+ import zenml
600
+
601
+
602
+ from zenml import pipeline
603
+
604
+
605
+ from zenml.config import DockerSettings
606
+
607
+
608
+ from pathlib import Path
609
+
610
+
611
+ import sys
612
+
613
+
614
+ docker_settings = DockerSettings(
615
+
616
+
617
+ dockerfile="deepchecks-zenml.Dockerfile",
618
+
619
+
620
+ build_options={
621
+
622
+
623
+ "buildargs": {
624
+
625
+
626
+ "ZENML_VERSION": f"{zenml.__version__}"
627
+
628
+
629
+ },
630
+
631
+
632
+ },
633
+
634
+
635
+ @pipeline(settings={"docker": docker_settings})
636
+
637
+
638
+ def my_pipeline(...):
639
+
640
+
641
+ # same code as always
642
+
643
+
644
+ ...
645
+
646
+
647
+ From here on, you can continue to use the deepchecks integration as is explained
648
+ below.
649
+
650
+
651
+ The Deepchecks standard steps
652
+
653
+
654
+ ZenML wraps the Deepchecks functionality for tabular data in the form of four
655
+ standard steps:
656
+
657
+
658
+ DeepchecksDataIntegrityCheckStep: use it in your pipelines to run data integrity
659
+ tests on a single dataset
660
+
661
+
662
+ DeepchecksDataDriftCheckStep: use it in your pipelines to run data drift tests
663
+ on two datasets as input: target and reference.'
664
+ - ' gs://zenml-core_cloudbuild ┃┃ │ gs://zenml-datasets ┃
665
+
666
+
667
+ ┃ │ gs://zenml-internal-artifact-store ┃
668
+
669
+
670
+ ┃ │ gs://zenml-kubeflow-artifact-store ┃
671
+
672
+
673
+ ┃ │ gs://zenml-project-time-series-bucket ┃
674
+
675
+
676
+ ┠───────────────────────┼─────────────────────────────────────────────────┨
677
+
678
+
679
+ ┃ 🌀 kubernetes-cluster │ zenml-test-cluster ┃
680
+
681
+
682
+ ┠───────────────────────┼─────────────────────────────────────────────────┨
683
+
684
+
685
+ ┃ 🐳 docker-registry │ gcr.io/zenml-core ┃
686
+
687
+
688
+ ┗━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
689
+
690
+
691
+ Long-lived credentials (API keys, account keys)
692
+
693
+
694
+ This is the magic formula of authentication methods. When paired with another
695
+ ability, such as automatically generating short-lived API tokens, or impersonating
696
+ accounts or assuming roles, this is the ideal authentication mechanism to use,
697
+ particularly when using ZenML in production and when sharing results with other
698
+ members of your ZenML team.
699
+
700
+
701
+ As a general best practice, but implemented particularly well for cloud platforms,
702
+ account passwords are never directly used as a credential when authenticating
703
+ to the cloud platform APIs. There is always a process in place that exchanges
704
+ the account/password credential for another type of long-lived credential:
705
+
706
+
707
+ AWS uses the aws configure CLI command
708
+
709
+
710
+ GCP offers the gcloud auth application-default login CLI commands
711
+
712
+
713
+ Azure provides the az login CLI command
714
+
715
+
716
+ None of your original login information is stored on your local machine or used
717
+ to access workloads. Instead, an API key, account key or some other form of intermediate
718
+ credential is generated and stored on the local host and used to authenticate
719
+ to remote cloud service APIs.'
720
+ - ' should pick the one that best fits your use case.If you already have one or
721
+ more GCP Service Connectors configured in your ZenML deployment, you can check
722
+ which of them can be used to access the GCS bucket you want to use for your GCS
723
+ Artifact Store by running e.g.:
724
+
725
+
726
+ zenml service-connector list-resources --resource-type gcs-bucket
727
+
728
+
729
+ Example Command Output
730
+
731
+
732
+ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
733
+
734
+
735
+ ┃ CONNECTOR ID │ CONNECTOR NAME │ CONNECTOR TYPE
736
+ │ RESOURCE TYPE │ RESOURCE NAMES ┃
737
+
738
+
739
+ ┠──────────────────────────────────────┼─────────────────────┼────────────────┼───────────────┼─────────────────────────────────────────────────┨
740
+
741
+
742
+ ┃ 7f0c69ba-9424-40ae-8ea6-04f35c2eba9d │ gcp-user-account │ 🔵 gcp │
743
+ 📦 gcs-bucket │ gs://zenml-bucket-sl ┃
744
+
745
+
746
+ ┃ │ │ │ │
747
+ gs://zenml-core.appspot.com ┃
748
+
749
+
750
+ ┃ │ │ │ │
751
+ gs://zenml-core_cloudbuild ┃
752
+
753
+
754
+ ┃ │ │ │ │
755
+ gs://zenml-datasets ┃
756
+
757
+
758
+ ┃ │ │ │ │
759
+ gs://zenml-internal-artifact-store ┃
760
+
761
+
762
+ ┃ │ │ │ │
763
+ gs://zenml-kubeflow-artifact-store ┃
764
+
765
+
766
+ ┠──────────────────────────────────────┼─────────────────────┼────────────────┼───────────────┼─────────────────────────────────────────────────┨
767
+
768
+
769
+ ┃ 2a0bec1b-9787-4bd7-8d4a-9a47b6f61643 │ gcs-zenml-bucket-sl │ 🔵 gcp │
770
+ 📦 gcs-bucket │ gs://zenml-bucket-sl ┃'
771
+ - source_sentence: Is it possible to update the local AWS CLI configuration with credentials
772
+ extracted from the AWS Service Connector?
773
+ sentences:
774
+ - '36a885: Pull complete
775
+
776
+
777
+ c9c0554c8e6a: Pull completebacdcd847a66: Pull complete
778
+
779
+
780
+ 482033770844: Pull complete
781
+
782
+
783
+ Digest: sha256:bf2cc3895e70dfa1ee1cd90bbfa599fa4cd8df837e27184bac1ce1cc239ecd3f
784
+
785
+
786
+ Status: Downloaded newer image for 715803424590.dkr.ecr.us-east-1.amazonaws.com/zenml-server:latest
787
+
788
+
789
+ 715803424590.dkr.ecr.us-east-1.amazonaws.com/zenml-server:latest
790
+
791
+
792
+ It is also possible to update the local AWS CLI configuration with credentials
793
+ extracted from the AWS Service Connector:
794
+
795
+
796
+ zenml service-connector login aws-session-token --resource-type aws-generic
797
+
798
+
799
+ Example Command Output
800
+
801
+
802
+ Configured local AWS SDK profile ''zenml-c0f8e857''.
803
+
804
+
805
+ The ''aws-session-token'' AWS Service Connector connector was used to successfully
806
+ configure the local Generic AWS resource client/SDK.
807
+
808
+
809
+ A new profile is created in the local AWS CLI configuration holding the credentials.
810
+ It can be used to access AWS resources and services, e.g.:
811
+
812
+
813
+ aws --profile zenml-c0f8e857 s3 ls
814
+
815
+
816
+ Stack Components use
817
+
818
+
819
+ The S3 Artifact Store Stack Component can be connected to a remote AWS S3 bucket
820
+ through an AWS Service Connector.
821
+
822
+
823
+ The AWS Service Connector can also be used with any Orchestrator or Model Deployer
824
+ stack component flavor that relies on Kubernetes clusters to manage workloads.
825
+ This allows EKS Kubernetes container workloads to be managed without the need
826
+ to configure and maintain explicit AWS or Kubernetes kubectl configuration contexts
827
+ and credentials in the target environment and in the Stack Component.
828
+
829
+
830
+ Similarly, Container Registry Stack Components can be connected to an ECR Container
831
+ Registry through an AWS Service Connector. This allows container images to be
832
+ built and published to ECR container registries without the need to configure
833
+ explicit AWS credentials in the target environment or the Stack Component.
834
+
835
+
836
+ End-to-end examples'
837
+ - ' ┃┠──────────────────┼─────────────────────────────────────────────────────────────────────┨
838
+
839
+
840
+ ┃ RESOURCE TYPES │ 🌀 kubernetes-cluster ┃
841
+
842
+
843
+ ┠──────────────────┼─────────────────────────────────────────────────────────────────────┨
844
+
845
+
846
+ ┃ RESOURCE NAME │ arn:aws:eks:us-east-1:715803424590:cluster/zenhacks-cluster ┃
847
+
848
+
849
+ ┠──────────────────┼─────────────────────────────────────────────────────────────────────┨
850
+
851
+
852
+ ┃ SECRET ID │ ┃
853
+
854
+
855
+ ┠──────────────────┼─────────────────────────────────────────────────────────────────────┨
856
+
857
+
858
+ ┃ SESSION DURATION │ N/A ┃
859
+
860
+
861
+ ┠──────────────────┼─────────────────────────────────────────────────────────────────────┨
862
+
863
+
864
+ ┃ EXPIRES IN │ 11h59m57s ┃
865
+
866
+
867
+ ┠──────────────────┼─────────────────────────────────────────────────────────────────────┨
868
+
869
+
870
+ ┃ OWNER │ default ┃
871
+
872
+
873
+ ┠──────────────────┼─────────────────────────────────────────────────────────────────────┨
874
+
875
+
876
+ ┃ WORKSPACE │ default ┃
877
+
878
+
879
+ ┠──────────────────┼─────────────────────────────────────────────────────────────────────┨
880
+
881
+
882
+ ┃ SHARED │ ➖ ┃
883
+
884
+
885
+ ┠──────────────────┼─────────────────────────────────────────────────────────────────────┨
886
+
887
+
888
+ ┃ CREATED_AT │ 2023-06-16 10:17:46.931091 ┃
889
+
890
+
891
+ ┠──────────────────┼─────────────────────────────────────────────────────────────────────┨
892
+
893
+
894
+ ┃ UPDATED_AT │ 2023-06-16 10:17:46.931094 ┃
895
+
896
+
897
+ ┗━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
898
+
899
+
900
+ Configuration'
901
+ - 'e --authentication_secret. For example, you''d run:zenml secret create argilla_secrets
902
+ --api_key="<your_argilla_api_key>"
903
+
904
+
905
+ (Visit the Argilla documentation and interface to obtain your API key.)
906
+
907
+
908
+ Then register your annotator with ZenML:
909
+
910
+
911
+ zenml annotator register argilla --flavor argilla --authentication_secret=argilla_secrets
912
+
913
+
914
+ When using a deployed instance of Argilla, the instance URL must be specified
915
+ without any trailing / at the end. If you are using a Hugging Face Spaces instance
916
+ and its visibility is set to private, you must also set the extra_headers parameter
917
+ which would include a Hugging Face token. For example:
918
+
919
+
920
+ zenml annotator register argilla --flavor argilla --authentication_secret=argilla_secrets
921
+ --instance_url="https://[your-owner-name]-[your_space_name].hf.space" --extra_headers="{"Authorization":
922
+ f"Bearer {<your_hugging_face_token>}"}"
923
+
924
+
925
+ Finally, add all these components to a stack and set it as your active stack.
926
+ For example:
927
+
928
+
929
+ zenml stack copy default annotation
930
+
931
+
932
+ # this must be done separately so that the other required stack components are
933
+ first registered
934
+
935
+
936
+ zenml stack update annotation -an <YOUR_ARGILLA_ANNOTATOR>
937
+
938
+
939
+ zenml stack set annotation
940
+
941
+
942
+ # optionally also
943
+
944
+
945
+ zenml stack describe
946
+
947
+
948
+ Now if you run a simple CLI command like zenml annotator dataset list this should
949
+ work without any errors. You''re ready to use your annotator in your ML workflow!
950
+
951
+
952
+ How do you use it?
953
+
954
+
955
+ ZenML supports access to your data and annotations via the zenml annotator ...
956
+ CLI command. We have also implemented an interface to some of the common Argilla
957
+ functionality via the ZenML SDK.
958
+
959
+
960
+ You can access information about the datasets you''re using with the zenml annotator
961
+ dataset list. To work on annotation for a particular dataset, you can run zenml
962
+ annotator dataset annotate <dataset_name>. What follows is an overview of some
963
+ key components to the Argilla integration and how it can be used.
964
+
965
+
966
+ Argilla Annotator Stack Component'
967
+ model-index:
968
+ - name: zenml/finetuned-snowflake-arctic-embed-m
969
+ results:
970
+ - task:
971
+ type: information-retrieval
972
+ name: Information Retrieval
973
+ dataset:
974
+ name: dim 384
975
+ type: dim_384
976
+ metrics:
977
+ - type: cosine_accuracy@1
978
+ value: 0.29518072289156627
979
+ name: Cosine Accuracy@1
980
+ - type: cosine_accuracy@3
981
+ value: 0.6204819277108434
982
+ name: Cosine Accuracy@3
983
+ - type: cosine_accuracy@5
984
+ value: 0.6927710843373494
985
+ name: Cosine Accuracy@5
986
+ - type: cosine_accuracy@10
987
+ value: 0.7891566265060241
988
+ name: Cosine Accuracy@10
989
+ - type: cosine_precision@1
990
+ value: 0.29518072289156627
991
+ name: Cosine Precision@1
992
+ - type: cosine_precision@3
993
+ value: 0.20682730923694775
994
+ name: Cosine Precision@3
995
+ - type: cosine_precision@5
996
+ value: 0.13855421686746985
997
+ name: Cosine Precision@5
998
+ - type: cosine_precision@10
999
+ value: 0.0789156626506024
1000
+ name: Cosine Precision@10
1001
+ - type: cosine_recall@1
1002
+ value: 0.29518072289156627
1003
+ name: Cosine Recall@1
1004
+ - type: cosine_recall@3
1005
+ value: 0.6204819277108434
1006
+ name: Cosine Recall@3
1007
+ - type: cosine_recall@5
1008
+ value: 0.6927710843373494
1009
+ name: Cosine Recall@5
1010
+ - type: cosine_recall@10
1011
+ value: 0.7891566265060241
1012
+ name: Cosine Recall@10
1013
+ - type: cosine_ndcg@10
1014
+ value: 0.5524302146116403
1015
+ name: Cosine Ndcg@10
1016
+ - type: cosine_mrr@10
1017
+ value: 0.4758486326257412
1018
+ name: Cosine Mrr@10
1019
+ - type: cosine_map@100
1020
+ value: 0.4836255621339311
1021
+ name: Cosine Map@100
1022
+ - task:
1023
+ type: information-retrieval
1024
+ name: Information Retrieval
1025
+ dataset:
1026
+ name: dim 256
1027
+ type: dim_256
1028
+ metrics:
1029
+ - type: cosine_accuracy@1
1030
+ value: 0.28313253012048195
1031
+ name: Cosine Accuracy@1
1032
+ - type: cosine_accuracy@3
1033
+ value: 0.5963855421686747
1034
+ name: Cosine Accuracy@3
1035
+ - type: cosine_accuracy@5
1036
+ value: 0.6807228915662651
1037
+ name: Cosine Accuracy@5
1038
+ - type: cosine_accuracy@10
1039
+ value: 0.7771084337349398
1040
+ name: Cosine Accuracy@10
1041
+ - type: cosine_precision@1
1042
+ value: 0.28313253012048195
1043
+ name: Cosine Precision@1
1044
+ - type: cosine_precision@3
1045
+ value: 0.19879518072289157
1046
+ name: Cosine Precision@3
1047
+ - type: cosine_precision@5
1048
+ value: 0.136144578313253
1049
+ name: Cosine Precision@5
1050
+ - type: cosine_precision@10
1051
+ value: 0.07771084337349396
1052
+ name: Cosine Precision@10
1053
+ - type: cosine_recall@1
1054
+ value: 0.28313253012048195
1055
+ name: Cosine Recall@1
1056
+ - type: cosine_recall@3
1057
+ value: 0.5963855421686747
1058
+ name: Cosine Recall@3
1059
+ - type: cosine_recall@5
1060
+ value: 0.6807228915662651
1061
+ name: Cosine Recall@5
1062
+ - type: cosine_recall@10
1063
+ value: 0.7771084337349398
1064
+ name: Cosine Recall@10
1065
+ - type: cosine_ndcg@10
1066
+ value: 0.5376005319054157
1067
+ name: Cosine Ndcg@10
1068
+ - type: cosine_mrr@10
1069
+ value: 0.46014534327787354
1070
+ name: Cosine Mrr@10
1071
+ - type: cosine_map@100
1072
+ value: 0.4690725321460052
1073
+ name: Cosine Map@100
1074
+ - task:
1075
+ type: information-retrieval
1076
+ name: Information Retrieval
1077
+ dataset:
1078
+ name: dim 128
1079
+ type: dim_128
1080
+ metrics:
1081
+ - type: cosine_accuracy@1
1082
+ value: 0.2710843373493976
1083
+ name: Cosine Accuracy@1
1084
+ - type: cosine_accuracy@3
1085
+ value: 0.5301204819277109
1086
+ name: Cosine Accuracy@3
1087
+ - type: cosine_accuracy@5
1088
+ value: 0.5963855421686747
1089
+ name: Cosine Accuracy@5
1090
+ - type: cosine_accuracy@10
1091
+ value: 0.7409638554216867
1092
+ name: Cosine Accuracy@10
1093
+ - type: cosine_precision@1
1094
+ value: 0.2710843373493976
1095
+ name: Cosine Precision@1
1096
+ - type: cosine_precision@3
1097
+ value: 0.17670682730923692
1098
+ name: Cosine Precision@3
1099
+ - type: cosine_precision@5
1100
+ value: 0.11927710843373492
1101
+ name: Cosine Precision@5
1102
+ - type: cosine_precision@10
1103
+ value: 0.07409638554216866
1104
+ name: Cosine Precision@10
1105
+ - type: cosine_recall@1
1106
+ value: 0.2710843373493976
1107
+ name: Cosine Recall@1
1108
+ - type: cosine_recall@3
1109
+ value: 0.5301204819277109
1110
+ name: Cosine Recall@3
1111
+ - type: cosine_recall@5
1112
+ value: 0.5963855421686747
1113
+ name: Cosine Recall@5
1114
+ - type: cosine_recall@10
1115
+ value: 0.7409638554216867
1116
+ name: Cosine Recall@10
1117
+ - type: cosine_ndcg@10
1118
+ value: 0.49831034220322973
1119
+ name: Cosine Ndcg@10
1120
+ - type: cosine_mrr@10
1121
+ value: 0.4218158347676423
1122
+ name: Cosine Mrr@10
1123
+ - type: cosine_map@100
1124
+ value: 0.43128822737879013
1125
+ name: Cosine Map@100
1126
+ - task:
1127
+ type: information-retrieval
1128
+ name: Information Retrieval
1129
+ dataset:
1130
+ name: dim 64
1131
+ type: dim_64
1132
+ metrics:
1133
+ - type: cosine_accuracy@1
1134
+ value: 0.26506024096385544
1135
+ name: Cosine Accuracy@1
1136
+ - type: cosine_accuracy@3
1137
+ value: 0.4819277108433735
1138
+ name: Cosine Accuracy@3
1139
+ - type: cosine_accuracy@5
1140
+ value: 0.5662650602409639
1141
+ name: Cosine Accuracy@5
1142
+ - type: cosine_accuracy@10
1143
+ value: 0.6566265060240963
1144
+ name: Cosine Accuracy@10
1145
+ - type: cosine_precision@1
1146
+ value: 0.26506024096385544
1147
+ name: Cosine Precision@1
1148
+ - type: cosine_precision@3
1149
+ value: 0.1606425702811245
1150
+ name: Cosine Precision@3
1151
+ - type: cosine_precision@5
1152
+ value: 0.11325301204819276
1153
+ name: Cosine Precision@5
1154
+ - type: cosine_precision@10
1155
+ value: 0.06566265060240963
1156
+ name: Cosine Precision@10
1157
+ - type: cosine_recall@1
1158
+ value: 0.26506024096385544
1159
+ name: Cosine Recall@1
1160
+ - type: cosine_recall@3
1161
+ value: 0.4819277108433735
1162
+ name: Cosine Recall@3
1163
+ - type: cosine_recall@5
1164
+ value: 0.5662650602409639
1165
+ name: Cosine Recall@5
1166
+ - type: cosine_recall@10
1167
+ value: 0.6566265060240963
1168
+ name: Cosine Recall@10
1169
+ - type: cosine_ndcg@10
1170
+ value: 0.45413104746517285
1171
+ name: Cosine Ndcg@10
1172
+ - type: cosine_mrr@10
1173
+ value: 0.38985465672212666
1174
+ name: Cosine Mrr@10
1175
+ - type: cosine_map@100
1176
+ value: 0.4019553541721889
1177
+ name: Cosine Map@100
1178
+ ---
1179
+
1180
+ # zenml/finetuned-snowflake-arctic-embed-m
1181
+
1182
+ This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [Snowflake/snowflake-arctic-embed-m](https://huggingface.co/Snowflake/snowflake-arctic-embed-m). It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
1183
+
1184
+ ## Model Details
1185
+
1186
+ ### Model Description
1187
+ - **Model Type:** Sentence Transformer
1188
+ - **Base model:** [Snowflake/snowflake-arctic-embed-m](https://huggingface.co/Snowflake/snowflake-arctic-embed-m) <!-- at revision 71bc94c8f9ea1e54fba11167004205a65e5da2cc -->
1189
+ - **Maximum Sequence Length:** 512 tokens
1190
+ - **Output Dimensionality:** 768 tokens
1191
+ - **Similarity Function:** Cosine Similarity
1192
+ <!-- - **Training Dataset:** Unknown -->
1193
+ - **Language:** en
1194
+ - **License:** apache-2.0
1195
+
1196
+ ### Model Sources
1197
+
1198
+ - **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
1199
+ - **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
1200
+ - **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
1201
+
1202
+ ### Full Model Architecture
1203
+
1204
+ ```
1205
+ SentenceTransformer(
1206
+ (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: BertModel
1207
+ (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
1208
+ (2): Normalize()
1209
+ )
1210
+ ```
1211
+
1212
+ ## Usage
1213
+
1214
+ ### Direct Usage (Sentence Transformers)
1215
+
1216
+ First install the Sentence Transformers library:
1217
+
1218
+ ```bash
1219
+ pip install -U sentence-transformers
1220
+ ```
1221
+
1222
+ Then you can load this model and run inference.
1223
+ ```python
1224
+ from sentence_transformers import SentenceTransformer
1225
+
1226
+ # Download from the 🤗 Hub
1227
+ model = SentenceTransformer("zenml/finetuned-snowflake-arctic-embed-m")
1228
+ # Run inference
1229
+ sentences = [
1230
+ 'Is it possible to update the local AWS CLI configuration with credentials extracted from the AWS Service Connector?',
1231
+ "36a885: Pull complete\n\nc9c0554c8e6a: Pull completebacdcd847a66: Pull complete\n\n482033770844: Pull complete\n\nDigest: sha256:bf2cc3895e70dfa1ee1cd90bbfa599fa4cd8df837e27184bac1ce1cc239ecd3f\n\nStatus: Downloaded newer image for 715803424590.dkr.ecr.us-east-1.amazonaws.com/zenml-server:latest\n\n715803424590.dkr.ecr.us-east-1.amazonaws.com/zenml-server:latest\n\nIt is also possible to update the local AWS CLI configuration with credentials extracted from the AWS Service Connector:\n\nzenml service-connector login aws-session-token --resource-type aws-generic\n\nExample Command Output\n\nConfigured local AWS SDK profile 'zenml-c0f8e857'.\n\nThe 'aws-session-token' AWS Service Connector connector was used to successfully configure the local Generic AWS resource client/SDK.\n\nA new profile is created in the local AWS CLI configuration holding the credentials. It can be used to access AWS resources and services, e.g.:\n\naws --profile zenml-c0f8e857 s3 ls\n\nStack Components use\n\nThe S3 Artifact Store Stack Component can be connected to a remote AWS S3 bucket through an AWS Service Connector.\n\nThe AWS Service Connector can also be used with any Orchestrator or Model Deployer stack component flavor that relies on Kubernetes clusters to manage workloads. This allows EKS Kubernetes container workloads to be managed without the need to configure and maintain explicit AWS or Kubernetes kubectl configuration contexts and credentials in the target environment and in the Stack Component.\n\nSimilarly, Container Registry Stack Components can be connected to an ECR Container Registry through an AWS Service Connector. This allows container images to be built and published to ECR container registries without the need to configure explicit AWS credentials in the target environment or the Stack Component.\n\nEnd-to-end examples",
1232
+ 'e --authentication_secret. For example, you\'d run:zenml secret create argilla_secrets --api_key="<your_argilla_api_key>"\n\n(Visit the Argilla documentation and interface to obtain your API key.)\n\nThen register your annotator with ZenML:\n\nzenml annotator register argilla --flavor argilla --authentication_secret=argilla_secrets\n\nWhen using a deployed instance of Argilla, the instance URL must be specified without any trailing / at the end. If you are using a Hugging Face Spaces instance and its visibility is set to private, you must also set the extra_headers parameter which would include a Hugging Face token. For example:\n\nzenml annotator register argilla --flavor argilla --authentication_secret=argilla_secrets --instance_url="https://[your-owner-name]-[your_space_name].hf.space" --extra_headers="{"Authorization": f"Bearer {<your_hugging_face_token>}"}"\n\nFinally, add all these components to a stack and set it as your active stack. For example:\n\nzenml stack copy default annotation\n\n# this must be done separately so that the other required stack components are first registered\n\nzenml stack update annotation -an <YOUR_ARGILLA_ANNOTATOR>\n\nzenml stack set annotation\n\n# optionally also\n\nzenml stack describe\n\nNow if you run a simple CLI command like zenml annotator dataset list this should work without any errors. You\'re ready to use your annotator in your ML workflow!\n\nHow do you use it?\n\nZenML supports access to your data and annotations via the zenml annotator ... CLI command. We have also implemented an interface to some of the common Argilla functionality via the ZenML SDK.\n\nYou can access information about the datasets you\'re using with the zenml annotator dataset list. To work on annotation for a particular dataset, you can run zenml annotator dataset annotate <dataset_name>. What follows is an overview of some key components to the Argilla integration and how it can be used.\n\nArgilla Annotator Stack Component',
1233
+ ]
1234
+ embeddings = model.encode(sentences)
1235
+ print(embeddings.shape)
1236
+ # [3, 768]
1237
+
1238
+ # Get the similarity scores for the embeddings
1239
+ similarities = model.similarity(embeddings, embeddings)
1240
+ print(similarities.shape)
1241
+ # [3, 3]
1242
+ ```
1243
+
1244
+ <!--
1245
+ ### Direct Usage (Transformers)
1246
+
1247
+ <details><summary>Click to see the direct usage in Transformers</summary>
1248
+
1249
+ </details>
1250
+ -->
1251
+
1252
+ <!--
1253
+ ### Downstream Usage (Sentence Transformers)
1254
+
1255
+ You can finetune this model on your own dataset.
1256
+
1257
+ <details><summary>Click to expand</summary>
1258
+
1259
+ </details>
1260
+ -->
1261
+
1262
+ <!--
1263
+ ### Out-of-Scope Use
1264
+
1265
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
1266
+ -->
1267
+
1268
+ ## Evaluation
1269
+
1270
+ ### Metrics
1271
+
1272
+ #### Information Retrieval
1273
+ * Dataset: `dim_384`
1274
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
1275
+
1276
+ | Metric | Value |
1277
+ |:--------------------|:-----------|
1278
+ | cosine_accuracy@1 | 0.2952 |
1279
+ | cosine_accuracy@3 | 0.6205 |
1280
+ | cosine_accuracy@5 | 0.6928 |
1281
+ | cosine_accuracy@10 | 0.7892 |
1282
+ | cosine_precision@1 | 0.2952 |
1283
+ | cosine_precision@3 | 0.2068 |
1284
+ | cosine_precision@5 | 0.1386 |
1285
+ | cosine_precision@10 | 0.0789 |
1286
+ | cosine_recall@1 | 0.2952 |
1287
+ | cosine_recall@3 | 0.6205 |
1288
+ | cosine_recall@5 | 0.6928 |
1289
+ | cosine_recall@10 | 0.7892 |
1290
+ | cosine_ndcg@10 | 0.5524 |
1291
+ | cosine_mrr@10 | 0.4758 |
1292
+ | **cosine_map@100** | **0.4836** |
1293
+
1294
+ #### Information Retrieval
1295
+ * Dataset: `dim_256`
1296
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
1297
+
1298
+ | Metric | Value |
1299
+ |:--------------------|:-----------|
1300
+ | cosine_accuracy@1 | 0.2831 |
1301
+ | cosine_accuracy@3 | 0.5964 |
1302
+ | cosine_accuracy@5 | 0.6807 |
1303
+ | cosine_accuracy@10 | 0.7771 |
1304
+ | cosine_precision@1 | 0.2831 |
1305
+ | cosine_precision@3 | 0.1988 |
1306
+ | cosine_precision@5 | 0.1361 |
1307
+ | cosine_precision@10 | 0.0777 |
1308
+ | cosine_recall@1 | 0.2831 |
1309
+ | cosine_recall@3 | 0.5964 |
1310
+ | cosine_recall@5 | 0.6807 |
1311
+ | cosine_recall@10 | 0.7771 |
1312
+ | cosine_ndcg@10 | 0.5376 |
1313
+ | cosine_mrr@10 | 0.4601 |
1314
+ | **cosine_map@100** | **0.4691** |
1315
+
1316
+ #### Information Retrieval
1317
+ * Dataset: `dim_128`
1318
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
1319
+
1320
+ | Metric | Value |
1321
+ |:--------------------|:-----------|
1322
+ | cosine_accuracy@1 | 0.2711 |
1323
+ | cosine_accuracy@3 | 0.5301 |
1324
+ | cosine_accuracy@5 | 0.5964 |
1325
+ | cosine_accuracy@10 | 0.741 |
1326
+ | cosine_precision@1 | 0.2711 |
1327
+ | cosine_precision@3 | 0.1767 |
1328
+ | cosine_precision@5 | 0.1193 |
1329
+ | cosine_precision@10 | 0.0741 |
1330
+ | cosine_recall@1 | 0.2711 |
1331
+ | cosine_recall@3 | 0.5301 |
1332
+ | cosine_recall@5 | 0.5964 |
1333
+ | cosine_recall@10 | 0.741 |
1334
+ | cosine_ndcg@10 | 0.4983 |
1335
+ | cosine_mrr@10 | 0.4218 |
1336
+ | **cosine_map@100** | **0.4313** |
1337
+
1338
+ #### Information Retrieval
1339
+ * Dataset: `dim_64`
1340
+ * Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
1341
+
1342
+ | Metric | Value |
1343
+ |:--------------------|:----------|
1344
+ | cosine_accuracy@1 | 0.2651 |
1345
+ | cosine_accuracy@3 | 0.4819 |
1346
+ | cosine_accuracy@5 | 0.5663 |
1347
+ | cosine_accuracy@10 | 0.6566 |
1348
+ | cosine_precision@1 | 0.2651 |
1349
+ | cosine_precision@3 | 0.1606 |
1350
+ | cosine_precision@5 | 0.1133 |
1351
+ | cosine_precision@10 | 0.0657 |
1352
+ | cosine_recall@1 | 0.2651 |
1353
+ | cosine_recall@3 | 0.4819 |
1354
+ | cosine_recall@5 | 0.5663 |
1355
+ | cosine_recall@10 | 0.6566 |
1356
+ | cosine_ndcg@10 | 0.4541 |
1357
+ | cosine_mrr@10 | 0.3899 |
1358
+ | **cosine_map@100** | **0.402** |
1359
+
1360
+ <!--
1361
+ ## Bias, Risks and Limitations
1362
+
1363
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
1364
+ -->
1365
+
1366
+ <!--
1367
+ ### Recommendations
1368
+
1369
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
1370
+ -->
1371
+
1372
+ ## Training Details
1373
+
1374
+ ### Training Dataset
1375
+
1376
+ #### Unnamed Dataset
1377
+
1378
+
1379
+ * Size: 1,490 training samples
1380
+ * Columns: <code>positive</code> and <code>anchor</code>
1381
+ * Approximate statistics based on the first 1000 samples:
1382
+ | | positive | anchor |
1383
+ |:--------|:-----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|
1384
+ | type | string | string |
1385
+ | details | <ul><li>min: 10 tokens</li><li>mean: 21.19 tokens</li><li>max: 64 tokens</li></ul> | <ul><li>min: 21 tokens</li><li>mean: 374.24 tokens</li><li>max: 512 tokens</li></ul> |
1386
+ * Samples:
1387
+ | positive | anchor |
1388
+ |:---------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
1389
+ | <code>How do I use it to start the local Airflow server for ZenML?</code> | <code> use it<br><br>To use the Airflow orchestrator, we need:The ZenML airflow integration installed. If you haven't done so, runCopyzenml integration install airflow<br><br>Docker installed and running.<br><br>The orchestrator registered and part of our active stack:<br><br>zenml orchestrator register <ORCHESTRATOR_NAME> \<br><br>--flavor=airflow \<br><br>--local=True # set this to `False` if using a remote Airflow deployment<br><br># Register and activate a stack with the new orchestrator<br><br>zenml stack register <STACK_NAME> -o <ORCHESTRATOR_NAME> ... --set<br><br>In the local case, we need to reinstall in a certain way for the local Airflow server:<br><br>pip install "apache-airflow-providers-docker<3.8.0" "apache-airflow==2.4.0" "pendulum<3.0.0" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.4.0/constraints-3.9.txt"<br><br>Please make sure to replace 3.9 with your Python (major) version in the constraints file URL given above.<br><br>Once that is installed, we can start the local Airflow server by running the following command in your terminal. See further below on an alternative way to set up the Airflow server manually since the zenml stack up command is deprecated.<br><br>zenml stack up<br><br>This command will start up an Airflow server on your local machine that's running in the same Python environment that you used to provision it. When it is finished, it will print a username and password which you can use to log in to the Airflow UI here.<br><br>As long as you didn't configure any custom value for the dag_output_dir attribute of your orchestrator, running a pipeline locally is as simple as calling:<br><br>python file_that_runs_a_zenml_pipeline.py<br><br>This call will produce a .zip file containing a representation of your ZenML pipeline to the Airflow DAGs directory. From there, the local Airflow server will load it and run your pipeline (It might take a few seconds until the pipeline shows up in the Airflow UI).</code> |
1390
+ | <code>What are the best practices for various authentication methods implemented by Service Connectors?</code> | <code>Security best practices<br><br>Best practices concerning the various authentication methods implemented by Service Connectors.<br><br>Service Connector Types, especially those targeted at cloud providers, offer a plethora of authentication methods matching those supported by remote cloud platforms. While there is no single authentication standard that unifies this process, there are some patterns that are easily identifiable and can be used as guidelines when deciding which authentication method to use to configure a Service Connector.<br><br>This section explores some of those patterns and gives some advice regarding which authentication methods are best suited for your needs.<br><br>This section may require some general knowledge about authentication and authorization to be properly understood. We tried to keep it simple and limit ourselves to talking about high-level concepts, but some areas may get a bit too technical.<br><br>Username and password<br><br>The key takeaway is this: you should avoid using your primary account password as authentication credentials as much as possible. If there are alternative authentication methods that you can use or other types of credentials (e.g. session tokens, API keys, API tokens), you should always try to use those instead.<br><br>Ultimately, if you have no choice, be cognizant of the third parties you share your passwords with. If possible, they should never leave the premises of your local host or development environment.<br><br>This is the typical authentication method that uses a username or account name plus the associated password. While this is the de facto method used to log in with web consoles and local CLIs, this is the least secure of all authentication methods and never something you want to share with other members of your team or organization or use to authenticate automated workloads.</code> |
1391
+ | <code>How can I interact with a model deployer after deploying a model in ZenML?</code> | <code>eline_step_name="huggingface_model_deployer_step",model_name="LLAMA-7B",<br><br>model_uri="s3://zenprojects/huggingface_model_deployer_step/output/884/huggingface",<br><br>revision="main",<br><br>task="text-classification",<br><br>region="us-east-1",<br><br>vendor="aws",<br><br>token="huggingface_token",<br><br>namespace="zenml-workloads",<br><br>endpoint_type="public",<br><br>print(f"Model server {service.config['model_name']} is deployed at {service.status['prediction_url']}")<br><br>How to Interact with a model deployer after deployment?<br><br>When a Model Deployer is part of the active ZenML Stack, it is also possible to interact with it from the CLI to list, start, stop, or delete the model servers that is managed:<br><br>$ zenml model-deployer models list<br><br>┏━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓<br><br>┃ STATUS │ UUID │ PIPELINE_NAME │ PIPELINE_STEP_NAME ┃<br><br>┠────────┼──────────────────────────────────────┼────────────────────────────────┼────────────────────────────┨<br><br>┃ ✅ │ 8cbe671b-9fce-4394-a051-68e001f92765 │ seldon_deployment_pipeline │ seldon_model_deployer_step ┃<br><br>┗━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛<br><br>$ zenml model-deployer models describe 8cbe671b-9fce-4394-a051-68e001f92765<br><br>Properties of Served Model 8cbe671b-9fce-4394-a051-68e001f92765<br><br>┏━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓<br><br>┃ MODEL SERVICE PROPERTY │ VALUE ┃<br><br>┠────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┨<br><br>┃ MODEL_NAME │ mnist ┃<br><br>┠────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────┨</code> |
1392
+ * Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
1393
+ ```json
1394
+ {
1395
+ "loss": "MultipleNegativesRankingLoss",
1396
+ "matryoshka_dims": [
1397
+ 384,
1398
+ 256,
1399
+ 128,
1400
+ 64
1401
+ ],
1402
+ "matryoshka_weights": [
1403
+ 1,
1404
+ 1,
1405
+ 1,
1406
+ 1
1407
+ ],
1408
+ "n_dims_per_step": -1
1409
+ }
1410
+ ```
1411
+
1412
+ ### Training Hyperparameters
1413
+ #### Non-Default Hyperparameters
1414
+
1415
+ - `eval_strategy`: epoch
1416
+ - `per_device_train_batch_size`: 32
1417
+ - `per_device_eval_batch_size`: 16
1418
+ - `gradient_accumulation_steps`: 16
1419
+ - `learning_rate`: 2e-05
1420
+ - `num_train_epochs`: 4
1421
+ - `lr_scheduler_type`: cosine
1422
+ - `warmup_ratio`: 0.1
1423
+ - `bf16`: True
1424
+ - `tf32`: True
1425
+ - `load_best_model_at_end`: True
1426
+ - `optim`: adamw_torch_fused
1427
+ - `batch_sampler`: no_duplicates
1428
+
1429
+ #### All Hyperparameters
1430
+ <details><summary>Click to expand</summary>
1431
+
1432
+ - `overwrite_output_dir`: False
1433
+ - `do_predict`: False
1434
+ - `eval_strategy`: epoch
1435
+ - `prediction_loss_only`: True
1436
+ - `per_device_train_batch_size`: 32
1437
+ - `per_device_eval_batch_size`: 16
1438
+ - `per_gpu_train_batch_size`: None
1439
+ - `per_gpu_eval_batch_size`: None
1440
+ - `gradient_accumulation_steps`: 16
1441
+ - `eval_accumulation_steps`: None
1442
+ - `learning_rate`: 2e-05
1443
+ - `weight_decay`: 0.0
1444
+ - `adam_beta1`: 0.9
1445
+ - `adam_beta2`: 0.999
1446
+ - `adam_epsilon`: 1e-08
1447
+ - `max_grad_norm`: 1.0
1448
+ - `num_train_epochs`: 4
1449
+ - `max_steps`: -1
1450
+ - `lr_scheduler_type`: cosine
1451
+ - `lr_scheduler_kwargs`: {}
1452
+ - `warmup_ratio`: 0.1
1453
+ - `warmup_steps`: 0
1454
+ - `log_level`: passive
1455
+ - `log_level_replica`: warning
1456
+ - `log_on_each_node`: True
1457
+ - `logging_nan_inf_filter`: True
1458
+ - `save_safetensors`: True
1459
+ - `save_on_each_node`: False
1460
+ - `save_only_model`: False
1461
+ - `restore_callback_states_from_checkpoint`: False
1462
+ - `no_cuda`: False
1463
+ - `use_cpu`: False
1464
+ - `use_mps_device`: False
1465
+ - `seed`: 42
1466
+ - `data_seed`: None
1467
+ - `jit_mode_eval`: False
1468
+ - `use_ipex`: False
1469
+ - `bf16`: True
1470
+ - `fp16`: False
1471
+ - `fp16_opt_level`: O1
1472
+ - `half_precision_backend`: auto
1473
+ - `bf16_full_eval`: False
1474
+ - `fp16_full_eval`: False
1475
+ - `tf32`: True
1476
+ - `local_rank`: 0
1477
+ - `ddp_backend`: None
1478
+ - `tpu_num_cores`: None
1479
+ - `tpu_metrics_debug`: False
1480
+ - `debug`: []
1481
+ - `dataloader_drop_last`: False
1482
+ - `dataloader_num_workers`: 0
1483
+ - `dataloader_prefetch_factor`: None
1484
+ - `past_index`: -1
1485
+ - `disable_tqdm`: True
1486
+ - `remove_unused_columns`: True
1487
+ - `label_names`: None
1488
+ - `load_best_model_at_end`: True
1489
+ - `ignore_data_skip`: False
1490
+ - `fsdp`: []
1491
+ - `fsdp_min_num_params`: 0
1492
+ - `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
1493
+ - `fsdp_transformer_layer_cls_to_wrap`: None
1494
+ - `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
1495
+ - `deepspeed`: None
1496
+ - `label_smoothing_factor`: 0.0
1497
+ - `optim`: adamw_torch_fused
1498
+ - `optim_args`: None
1499
+ - `adafactor`: False
1500
+ - `group_by_length`: False
1501
+ - `length_column_name`: length
1502
+ - `ddp_find_unused_parameters`: None
1503
+ - `ddp_bucket_cap_mb`: None
1504
+ - `ddp_broadcast_buffers`: False
1505
+ - `dataloader_pin_memory`: True
1506
+ - `dataloader_persistent_workers`: False
1507
+ - `skip_memory_metrics`: True
1508
+ - `use_legacy_prediction_loop`: False
1509
+ - `push_to_hub`: False
1510
+ - `resume_from_checkpoint`: None
1511
+ - `hub_model_id`: None
1512
+ - `hub_strategy`: every_save
1513
+ - `hub_private_repo`: False
1514
+ - `hub_always_push`: False
1515
+ - `gradient_checkpointing`: False
1516
+ - `gradient_checkpointing_kwargs`: None
1517
+ - `include_inputs_for_metrics`: False
1518
+ - `eval_do_concat_batches`: True
1519
+ - `fp16_backend`: auto
1520
+ - `push_to_hub_model_id`: None
1521
+ - `push_to_hub_organization`: None
1522
+ - `mp_parameters`:
1523
+ - `auto_find_batch_size`: False
1524
+ - `full_determinism`: False
1525
+ - `torchdynamo`: None
1526
+ - `ray_scope`: last
1527
+ - `ddp_timeout`: 1800
1528
+ - `torch_compile`: False
1529
+ - `torch_compile_backend`: None
1530
+ - `torch_compile_mode`: None
1531
+ - `dispatch_batches`: None
1532
+ - `split_batches`: None
1533
+ - `include_tokens_per_second`: False
1534
+ - `include_num_input_tokens_seen`: False
1535
+ - `neftune_noise_alpha`: None
1536
+ - `optim_target_modules`: None
1537
+ - `batch_eval_metrics`: False
1538
+ - `batch_sampler`: no_duplicates
1539
+ - `multi_dataset_batch_sampler`: proportional
1540
+
1541
+ </details>
1542
+
1543
+ ### Training Logs
1544
+ | Epoch | Step | dim_128_cosine_map@100 | dim_256_cosine_map@100 | dim_384_cosine_map@100 | dim_64_cosine_map@100 |
1545
+ |:----------:|:-----:|:----------------------:|:----------------------:|:----------------------:|:---------------------:|
1546
+ | 0.6667 | 1 | 0.3484 | 0.4016 | 0.4286 | 0.2904 |
1547
+ | 2.0 | 3 | 0.4266 | 0.4650 | 0.4774 | 0.3927 |
1548
+ | **2.6667** | **4** | **0.4313** | **0.4691** | **0.4836** | **0.402** |
1549
+
1550
+ * The bold row denotes the saved checkpoint.
1551
+
1552
+ ### Framework Versions
1553
+ - Python: 3.10.14
1554
+ - Sentence Transformers: 3.0.1
1555
+ - Transformers: 4.41.2
1556
+ - PyTorch: 2.3.1+cu121
1557
+ - Accelerate: 0.31.0
1558
+ - Datasets: 2.19.1
1559
+ - Tokenizers: 0.19.1
1560
+
1561
+ ## Citation
1562
+
1563
+ ### BibTeX
1564
+
1565
+ #### Sentence Transformers
1566
+ ```bibtex
1567
+ @inproceedings{reimers-2019-sentence-bert,
1568
+ title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
1569
+ author = "Reimers, Nils and Gurevych, Iryna",
1570
+ booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
1571
+ month = "11",
1572
+ year = "2019",
1573
+ publisher = "Association for Computational Linguistics",
1574
+ url = "https://arxiv.org/abs/1908.10084",
1575
+ }
1576
+ ```
1577
+
1578
+ #### MatryoshkaLoss
1579
+ ```bibtex
1580
+ @misc{kusupati2024matryoshka,
1581
+ title={Matryoshka Representation Learning},
1582
+ author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
1583
+ year={2024},
1584
+ eprint={2205.13147},
1585
+ archivePrefix={arXiv},
1586
+ primaryClass={cs.LG}
1587
+ }
1588
+ ```
1589
+
1590
+ #### MultipleNegativesRankingLoss
1591
+ ```bibtex
1592
+ @misc{henderson2017efficient,
1593
+ title={Efficient Natural Language Response Suggestion for Smart Reply},
1594
+ author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
1595
+ year={2017},
1596
+ eprint={1705.00652},
1597
+ archivePrefix={arXiv},
1598
+ primaryClass={cs.CL}
1599
+ }
1600
+ ```
1601
+
1602
+ <!--
1603
+ ## Glossary
1604
+
1605
+ *Clearly define terms in order to be accessible across audiences.*
1606
+ -->
1607
+
1608
+ <!--
1609
+ ## Model Card Authors
1610
+
1611
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
1612
+ -->
1613
+
1614
+ <!--
1615
+ ## Model Card Contact
1616
+
1617
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
1618
+ -->
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "Snowflake/snowflake-arctic-embed-m",
3
+ "architectures": [
4
+ "BertModel"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "classifier_dropout": null,
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "layer_norm_eps": 1e-12,
15
+ "max_position_embeddings": 512,
16
+ "model_type": "bert",
17
+ "num_attention_heads": 12,
18
+ "num_hidden_layers": 12,
19
+ "pad_token_id": 0,
20
+ "position_embedding_type": "absolute",
21
+ "torch_dtype": "float32",
22
+ "transformers_version": "4.41.2",
23
+ "type_vocab_size": 2,
24
+ "use_cache": true,
25
+ "vocab_size": 30522
26
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "3.0.1",
4
+ "transformers": "4.41.2",
5
+ "pytorch": "2.3.1+cu121"
6
+ },
7
+ "prompts": {
8
+ "query": "Represent this sentence for searching relevant passages: "
9
+ },
10
+ "default_prompt_name": null,
11
+ "similarity_fn_name": null
12
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93f2d851902a7e7bc5ffa4ba654ebdd55bbc5881917f930c95654c698cc55cb2
3
+ size 435588776
modules.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ },
14
+ {
15
+ "idx": 2,
16
+ "name": "2",
17
+ "path": "2_Normalize",
18
+ "type": "sentence_transformers.models.Normalize"
19
+ }
20
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 512,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "mask_token": {
10
+ "content": "[MASK]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "pad_token": {
17
+ "content": "[PAD]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "sep_token": {
24
+ "content": "[SEP]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "[UNK]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "[PAD]",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_lower_case": true,
47
+ "mask_token": "[MASK]",
48
+ "max_length": 512,
49
+ "model_max_length": 512,
50
+ "pad_to_multiple_of": null,
51
+ "pad_token": "[PAD]",
52
+ "pad_token_type_id": 0,
53
+ "padding_side": "right",
54
+ "sep_token": "[SEP]",
55
+ "stride": 0,
56
+ "strip_accents": null,
57
+ "tokenize_chinese_chars": true,
58
+ "tokenizer_class": "BertTokenizer",
59
+ "truncation_side": "right",
60
+ "truncation_strategy": "longest_first",
61
+ "unk_token": "[UNK]"
62
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff