Add new SentenceTransformer model.
Browse files- 1_Pooling/config.json +10 -0
- README.md +1687 -0
- config.json +26 -0
- config_sentence_transformers.json +10 -0
- model.safetensors +3 -0
- modules.json +20 -0
- sentence_bert_config.json +4 -0
- special_tokens_map.json +37 -0
- tokenizer.json +0 -0
- tokenizer_config.json +64 -0
- vocab.txt +0 -0
1_Pooling/config.json
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"word_embedding_dimension": 384,
|
3 |
+
"pooling_mode_cls_token": false,
|
4 |
+
"pooling_mode_mean_tokens": true,
|
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,1687 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: sentence-transformers/all-MiniLM-L6-v2
|
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: Can you explain how to override the extract_metadata() method to
|
35 |
+
track custom metadata for artifacts in ZenML?
|
36 |
+
sentences:
|
37 |
+
- 'tional) Which Metadata to Extract for the ArtifactOptionally, you can override
|
38 |
+
the extract_metadata() method to track custom metadata for all artifacts saved
|
39 |
+
by your materializer. Anything you extract here will be displayed in the dashboard
|
40 |
+
next to your artifacts.
|
41 |
+
|
42 |
+
|
43 |
+
src.zenml.metadata.metadata_types that are displayed in a dedicated way in the
|
44 |
+
dashboard. See
|
45 |
+
|
46 |
+
|
47 |
+
src.zenml.metadata.metadata_types.MetadataType for more details.
|
48 |
+
|
49 |
+
|
50 |
+
By default, this method will only extract the storage size of an artifact, but
|
51 |
+
you can overwrite it to track anything you wish. E.g., the zenml.materializers.NumpyMaterializer
|
52 |
+
overwrites this method to track the shape, dtype, and some statistical properties
|
53 |
+
of each np.ndarray that it saves.
|
54 |
+
|
55 |
+
|
56 |
+
If you would like to disable artifact metadata extraction altogether, you can
|
57 |
+
set enable_artifact_metadata at either pipeline or step level via @pipeline(enable_artifact_metadata=False)
|
58 |
+
or @step(enable_artifact_metadata=False).
|
59 |
+
|
60 |
+
|
61 |
+
Skipping materialization
|
62 |
+
|
63 |
+
|
64 |
+
Skipping materialization might have unintended consequences for downstream tasks
|
65 |
+
that rely on materialized artifacts. Only skip materialization if there is no
|
66 |
+
other way to do what you want to do.
|
67 |
+
|
68 |
+
|
69 |
+
While materializers should in most cases be used to control how artifacts are
|
70 |
+
returned and consumed from pipeline steps, you might sometimes need to have a
|
71 |
+
completely unmaterialized artifact in a step, e.g., if you need to know the exact
|
72 |
+
path to where your artifact is stored.
|
73 |
+
|
74 |
+
|
75 |
+
An unmaterialized artifact is a zenml.materializers.UnmaterializedArtifact. Among
|
76 |
+
others, it has a property uri that points to the unique path in the artifact store
|
77 |
+
where the artifact is persisted. One can use an unmaterialized artifact by specifying
|
78 |
+
UnmaterializedArtifact as the type in the step:
|
79 |
+
|
80 |
+
|
81 |
+
from zenml.artifacts.unmaterialized_artifact import UnmaterializedArtifact
|
82 |
+
|
83 |
+
|
84 |
+
from zenml import step
|
85 |
+
|
86 |
+
|
87 |
+
@step
|
88 |
+
|
89 |
+
|
90 |
+
def my_step(my_artifact: UnmaterializedArtifact): # rather than pd.DataFrame
|
91 |
+
|
92 |
+
|
93 |
+
pass
|
94 |
+
|
95 |
+
|
96 |
+
Example'
|
97 |
+
- ' ┃┃ │ │ │ │
|
98 |
+
HTTP response headers: HTTPHeaderDict({''Audit-Id'': ''72558f83-e050-4fe3-93e5-9f7e66988a4c'',
|
99 |
+
''Cache-Control'': ┃
|
100 |
+
|
101 |
+
|
102 |
+
┃ │ │ │ │
|
103 |
+
''no-cache, private'', ''Content-Type'': ''application/json'', ''Date'': ''Fri,
|
104 |
+
09 Jun 2023 18:59:02 GMT'', ┃
|
105 |
+
|
106 |
+
|
107 |
+
┃ │ │ │ │
|
108 |
+
''Content-Length'': ''129''}) ┃
|
109 |
+
|
110 |
+
|
111 |
+
┃ │ │ │ │
|
112 |
+
HTTP response body: ┃
|
113 |
+
|
114 |
+
|
115 |
+
┃ │ │ │ │
|
116 |
+
{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Unauthorized","reason":"Unauth
|
117 |
+
┃
|
118 |
+
|
119 |
+
|
120 |
+
┃ │ │ │ │
|
121 |
+
orized","code":401} ┃
|
122 |
+
|
123 |
+
|
124 |
+
┃ │ │ │ │ ┃
|
125 |
+
|
126 |
+
|
127 |
+
┃ │ │ │ │ ┃
|
128 |
+
|
129 |
+
|
130 |
+
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷��━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛'
|
131 |
+
- 's/30267569827/locations/global/workloadIdentityP ┃┃ │ ools/mypool/providers/myprovider", ┃
|
132 |
+
|
133 |
+
|
134 |
+
┃ │ "subject_token_type": "urn:ietf:params:aws:token-type:aws4_request", ┃
|
135 |
+
|
136 |
+
|
137 |
+
┃ │ "service_account_impersonation_url": ┃
|
138 |
+
|
139 |
+
|
140 |
+
┃ │ "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/myrole@ ┃
|
141 |
+
|
142 |
+
|
143 |
+
┃ │ zenml-core.iam.gserviceaccount.com:generateAccessToken", ┃
|
144 |
+
|
145 |
+
|
146 |
+
┃ │ "token_url": "https://sts.googleapis.com/v1/token", ┃
|
147 |
+
|
148 |
+
|
149 |
+
┃ │ "credential_source": { ┃
|
150 |
+
|
151 |
+
|
152 |
+
┃ │ "environment_id": "aws1", ┃
|
153 |
+
|
154 |
+
|
155 |
+
┃ │ "region_url": ┃
|
156 |
+
|
157 |
+
|
158 |
+
┃ │ "http://169.254.169.254/latest/meta-data/placement/availability-zone", ┃
|
159 |
+
|
160 |
+
|
161 |
+
┃ │ "url": ┃
|
162 |
+
|
163 |
+
|
164 |
+
┃ │ "http://169.254.169.254/latest/meta-data/iam/security-credentials", ┃
|
165 |
+
|
166 |
+
|
167 |
+
┃ │ "regional_cred_verification_url": ┃
|
168 |
+
|
169 |
+
|
170 |
+
┃ │ "https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-
|
171 |
+
┃
|
172 |
+
|
173 |
+
|
174 |
+
┃ │ 15" ┃
|
175 |
+
|
176 |
+
|
177 |
+
┃ │ } ┃
|
178 |
+
|
179 |
+
|
180 |
+
┃ │ } ┃
|
181 |
+
|
182 |
+
|
183 |
+
┗━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
184 |
+
|
185 |
+
|
186 |
+
GCP OAuth 2.0 token'
|
187 |
+
- source_sentence: How does the `sync_new_data_to_label_studio` step ensure that new
|
188 |
+
annotations remain in sync with the ZenML artifact store?
|
189 |
+
sentences:
|
190 |
+
- 'nf,
|
191 |
+
|
192 |
+
|
193 |
+
step_config: "StepConfiguration",
|
194 |
+
|
195 |
+
|
196 |
+
) -> None:"""Configures Spark to handle backends like YARN, Mesos or Kubernetes."""
|
197 |
+
|
198 |
+
|
199 |
+
def _io_configuration(
|
200 |
+
|
201 |
+
|
202 |
+
self,
|
203 |
+
|
204 |
+
|
205 |
+
spark_config: SparkConf
|
206 |
+
|
207 |
+
|
208 |
+
) -> None:
|
209 |
+
|
210 |
+
|
211 |
+
"""Configures Spark to handle different input/output sources."""
|
212 |
+
|
213 |
+
|
214 |
+
def _additional_configuration(
|
215 |
+
|
216 |
+
|
217 |
+
self,
|
218 |
+
|
219 |
+
|
220 |
+
spark_config: SparkConf
|
221 |
+
|
222 |
+
|
223 |
+
) -> None:
|
224 |
+
|
225 |
+
|
226 |
+
"""Appends the user-defined configuration parameters."""
|
227 |
+
|
228 |
+
|
229 |
+
def _launch_spark_job(
|
230 |
+
|
231 |
+
|
232 |
+
self,
|
233 |
+
|
234 |
+
|
235 |
+
spark_config: SparkConf,
|
236 |
+
|
237 |
+
|
238 |
+
entrypoint_command: List[str]
|
239 |
+
|
240 |
+
|
241 |
+
) -> None:
|
242 |
+
|
243 |
+
|
244 |
+
"""Generates and executes a spark-submit command."""
|
245 |
+
|
246 |
+
|
247 |
+
def launch(
|
248 |
+
|
249 |
+
|
250 |
+
self,
|
251 |
+
|
252 |
+
|
253 |
+
info: "StepRunInfo",
|
254 |
+
|
255 |
+
|
256 |
+
entrypoint_command: List[str],
|
257 |
+
|
258 |
+
|
259 |
+
) -> None:
|
260 |
+
|
261 |
+
|
262 |
+
"""Launches the step on Spark."""
|
263 |
+
|
264 |
+
|
265 |
+
Under the base configuration, you will see the main configuration parameters:
|
266 |
+
|
267 |
+
|
268 |
+
master is the master URL for the cluster where Spark will run. You might see different
|
269 |
+
schemes for this URL with varying cluster managers such as Mesos, YARN, or Kubernetes.
|
270 |
+
|
271 |
+
|
272 |
+
deploy_mode can either be ''cluster'' (default) or ''client'' and it decides where
|
273 |
+
the driver node of the application will run.
|
274 |
+
|
275 |
+
|
276 |
+
submit_args is the JSON string of a dictionary, which will be used to define additional
|
277 |
+
parameters if required ( Spark has a wide variety of parameters, thus including
|
278 |
+
them all in a single class was deemed unnecessary.).
|
279 |
+
|
280 |
+
|
281 |
+
In addition to this configuration, the launch method of the step operator gets
|
282 |
+
additional configuration parameters from the DockerSettings and ResourceSettings.
|
283 |
+
As a result, the overall configuration happens in 4 base methods:
|
284 |
+
|
285 |
+
|
286 |
+
_resource_configuration translates the ZenML ResourceSettings object to Spark''s
|
287 |
+
own resource configuration.
|
288 |
+
|
289 |
+
|
290 |
+
_backend_configuration is responsible for cluster-manager-specific configuration.
|
291 |
+
|
292 |
+
|
293 |
+
_io_configuration is a critical method. Even though we have materializers, Spark
|
294 |
+
might require additional packages and configuration to work with a specific filesystem.
|
295 |
+
This method is used as an interface to provide this configuration.
|
296 |
+
|
297 |
+
|
298 |
+
_additional_configuration takes the submit_args, converts, and appends them to
|
299 |
+
the overall configuration.'
|
300 |
+
- 'Azure Blob Storage
|
301 |
+
|
302 |
+
|
303 |
+
Storing artifacts using Azure Blob Storage
|
304 |
+
|
305 |
+
|
306 |
+
The Azure Artifact Store is an Artifact Store flavor provided with the Azure ZenML
|
307 |
+
integration that uses the Azure Blob Storage managed object storage service to
|
308 |
+
store ZenML artifacts in an Azure Blob Storage container.
|
309 |
+
|
310 |
+
|
311 |
+
When would you want to use it?
|
312 |
+
|
313 |
+
|
314 |
+
Running ZenML pipelines with the local Artifact Store is usually sufficient if
|
315 |
+
you just want to evaluate ZenML or get started quickly without incurring the trouble
|
316 |
+
and the cost of employing cloud storage services in your stack. However, the local
|
317 |
+
Artifact Store becomes insufficient or unsuitable if you have more elaborate needs
|
318 |
+
for your project:
|
319 |
+
|
320 |
+
|
321 |
+
if you want to share your pipeline run results with other team members or stakeholders
|
322 |
+
inside or outside your organization
|
323 |
+
|
324 |
+
|
325 |
+
if you have other components in your stack that are running remotely (e.g. a Kubeflow
|
326 |
+
or Kubernetes Orchestrator running in a public cloud).
|
327 |
+
|
328 |
+
|
329 |
+
if you outgrow what your local machine can offer in terms of storage space and
|
330 |
+
need to use some form of private or public storage service that is shared with
|
331 |
+
others
|
332 |
+
|
333 |
+
|
334 |
+
if you are running pipelines at scale and need an Artifact Store that can handle
|
335 |
+
the demands of production-grade MLOps
|
336 |
+
|
337 |
+
|
338 |
+
In all these cases, you need an Artifact Store that is backed by a form of public
|
339 |
+
cloud or self-hosted shared object storage service.
|
340 |
+
|
341 |
+
|
342 |
+
You should use the Azure Artifact Store when you decide to keep your ZenML artifacts
|
343 |
+
in a shared object storage and if you have access to the Azure Blob Storage managed
|
344 |
+
service. You should consider one of the other Artifact Store flavors if you don''t
|
345 |
+
have access to the Azure Blob Storage service.
|
346 |
+
|
347 |
+
|
348 |
+
How do you deploy it?
|
349 |
+
|
350 |
+
|
351 |
+
The Azure Artifact Store flavor is provided by the Azure ZenML integration, you
|
352 |
+
need to install it on your local machine to be able to register an Azure Artifact
|
353 |
+
Store and add it to your stack:
|
354 |
+
|
355 |
+
|
356 |
+
zenml integration install azure -y'
|
357 |
+
- 'th the appropriate label config with Label Studio.get_labeled_data step - This
|
358 |
+
step will get all labeled data available for a particular dataset. Note that these
|
359 |
+
are output in a Label Studio annotation format, which will subsequently be converted
|
360 |
+
into a format appropriate for your specific use case.
|
361 |
+
|
362 |
+
|
363 |
+
sync_new_data_to_label_studio step - This step is for ensuring that ZenML is handling
|
364 |
+
the annotations and that the files being used are stored and synced with the ZenML
|
365 |
+
artifact store. This is an important step as part of a continuous annotation workflow
|
366 |
+
since you want all the subsequent steps of your workflow to remain in sync with
|
367 |
+
whatever new annotations are being made or have been created.
|
368 |
+
|
369 |
+
|
370 |
+
Helper Functions
|
371 |
+
|
372 |
+
|
373 |
+
Label Studio requires the use of what it calls ''label config'' when you are creating/registering
|
374 |
+
your dataset. These are strings containing HTML-like syntax that allow you to
|
375 |
+
define a custom interface for your annotation. ZenML provides three helper functions
|
376 |
+
that will construct these label config strings in the case of object detection,
|
377 |
+
image classification, and OCR. See the integrations.label_studio.label_config_generators
|
378 |
+
module for those three functions.
|
379 |
+
|
380 |
+
|
381 |
+
PreviousArgilla
|
382 |
+
|
383 |
+
|
384 |
+
NextPigeon
|
385 |
+
|
386 |
+
|
387 |
+
Last updated 15 days ago'
|
388 |
+
- source_sentence: How can I register an orchestrator in our active stack using a
|
389 |
+
Service Connector?
|
390 |
+
sentences:
|
391 |
+
- 'in our active stack. This can be done in two ways:If you have a Service Connector
|
392 |
+
configured to access the remote Kubernetes cluster, you no longer need to set
|
393 |
+
the kubernetes_context attribute to a local kubectl context. In fact, you don''t
|
394 |
+
need the local Kubernetes CLI at all. You can connect the stack component to the
|
395 |
+
Service Connector instead:Copy$ zenml orchestrator register <ORCHESTRATOR_NAME>
|
396 |
+
--flavor tekton
|
397 |
+
|
398 |
+
Running with active workspace: ''default'' (repository)
|
399 |
+
|
400 |
+
Running with active stack: ''default'' (repository)
|
401 |
+
|
402 |
+
Successfully registered orchestrator `<ORCHESTRATOR_NAME>`.
|
403 |
+
|
404 |
+
|
405 |
+
$ zenml service-connector list-resources --resource-type kubernetes-cluster -e
|
406 |
+
|
407 |
+
The following ''kubernetes-cluster'' resources can be accessed by service connectors
|
408 |
+
configured in your workspace:
|
409 |
+
|
410 |
+
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━��━━┯━━━━━━━━━━━━━━━━━━━━━┓
|
411 |
+
|
412 |
+
┃ CONNECTOR ID │ CONNECTOR NAME │ CONNECTOR TYPE
|
413 |
+
│ RESOURCE TYPE │ RESOURCE NAMES ┃
|
414 |
+
|
415 |
+
┠──────────────────────────────────────┼───────────────────────┼────────────────┼───────────────────────┼─────────────────────┨
|
416 |
+
|
417 |
+
┃ e33c9fac-5daa-48b2-87bb-0187d3782cde │ aws-iam-multi-eu │ 🔶 aws │
|
418 |
+
🌀 kubernetes-cluster │ kubeflowmultitenant ┃
|
419 |
+
|
420 |
+
┃ │ │ │ │
|
421 |
+
zenbox ┃
|
422 |
+
|
423 |
+
┠──────────────────────────────────────┼───────────────────────┼────────────────┼───────────────────────┼─────────────────────┨
|
424 |
+
|
425 |
+
┃ ed528d5a-d6cb-4fc4-bc52-c3d2d01643e5 │ aws-iam-multi-us │ 🔶 aws │
|
426 |
+
🌀 kubernetes-cluster │ zenhacks-cluster ┃
|
427 |
+
|
428 |
+
┠──────────────────────────────────────┼───────────────────────┼────────────────┼───────────────────────┼─────────────────────┨
|
429 |
+
|
430 |
+
┃ 1c54b32a-4889-4417-abbd-42d3ace3d03a │ gcp-sa-multi │ 🔵 gcp │
|
431 |
+
🌀 kubernetes-cluster │ zenml-test-cluster ┃
|
432 |
+
|
433 |
+
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━┛'
|
434 |
+
- 'e by passing the page argument to the list method.You can further restrict your
|
435 |
+
search by passing additional arguments that will be used to filter the results.
|
436 |
+
E.g., most resources have a user_id associated with them that can be set to only
|
437 |
+
list resources created by that specific user. The available filter argument options
|
438 |
+
are different for each list method; check out the method declaration in the Client
|
439 |
+
SDK documentation to find out which exact arguments are supported or have a look
|
440 |
+
at the fields of the corresponding filter model class.
|
441 |
+
|
442 |
+
|
443 |
+
Except for pipeline runs, all other resources will by default be ordered by creation
|
444 |
+
time ascending. E.g., client.list_artifacts() would return the first 50 artifacts
|
445 |
+
ever created. You can change the ordering by specifying the sort_by argument when
|
446 |
+
calling list methods.
|
447 |
+
|
448 |
+
|
449 |
+
Get Methods
|
450 |
+
|
451 |
+
|
452 |
+
Fetch a specific instance of a resource by either resource ID, name, or name prefix,
|
453 |
+
e.g.:
|
454 |
+
|
455 |
+
|
456 |
+
client.get_pipeline_run("413cfb42-a52c-4bf1-a2fd-78af2f7f0101") # ID
|
457 |
+
|
458 |
+
|
459 |
+
client.get_pipeline_run("first_pipeline-2023_06_20-16_20_13_274466") # Name
|
460 |
+
|
461 |
+
|
462 |
+
client.get_pipeline_run("first_pipeline-2023_06_20-16") # Name prefix
|
463 |
+
|
464 |
+
|
465 |
+
Create, Update, and Delete Methods
|
466 |
+
|
467 |
+
|
468 |
+
Methods for creating / updating / deleting resources are only available for some
|
469 |
+
of the resources and the required arguments are different for each resource. Checkout
|
470 |
+
the Client SDK Documentation to find out whether a specific resource supports
|
471 |
+
write operations through the Client and which arguments are required.
|
472 |
+
|
473 |
+
|
474 |
+
Active User and Active Stack
|
475 |
+
|
476 |
+
|
477 |
+
For some use cases you might need to know information about the user that you
|
478 |
+
are authenticated as or the stack that you have currently set as active. You can
|
479 |
+
fetch this information via the client.active_user and client.active_stack_model
|
480 |
+
properties respectively, e.g.:
|
481 |
+
|
482 |
+
|
483 |
+
my_runs_on_current_stack = client.list_pipeline_runs(
|
484 |
+
|
485 |
+
|
486 |
+
stack_id=client.active_stack_model.id, # on current stack
|
487 |
+
|
488 |
+
|
489 |
+
user_id=client.active_user.id, # ran by you
|
490 |
+
|
491 |
+
|
492 |
+
Resource Models'
|
493 |
+
- ' build to finish. More information: Build Timeout.We can register the image builder
|
494 |
+
and use it in our active stack:
|
495 |
+
|
496 |
+
|
497 |
+
zenml image-builder register <IMAGE_BUILDER_NAME> \
|
498 |
+
|
499 |
+
|
500 |
+
--flavor=gcp \
|
501 |
+
|
502 |
+
|
503 |
+
--cloud_builder_image=<BUILDER_IMAGE_NAME> \
|
504 |
+
|
505 |
+
|
506 |
+
--network=<DOCKER_NETWORK> \
|
507 |
+
|
508 |
+
|
509 |
+
--build_timeout=<BUILD_TIMEOUT_IN_SECONDS>
|
510 |
+
|
511 |
+
|
512 |
+
# Register and activate a stack with the new image builder
|
513 |
+
|
514 |
+
|
515 |
+
zenml stack register <STACK_NAME> -i <IMAGE_BUILDER_NAME> ... --set
|
516 |
+
|
517 |
+
|
518 |
+
You also need to set up authentication required to access the Cloud Build GCP
|
519 |
+
services.
|
520 |
+
|
521 |
+
|
522 |
+
Authentication Methods
|
523 |
+
|
524 |
+
|
525 |
+
Integrating and using a GCP Image Builder in your pipelines is not possible without
|
526 |
+
employing some form of authentication. If you''re looking for a quick way to get
|
527 |
+
started locally, you can use the Local Authentication method. However, the recommended
|
528 |
+
way to authenticate to the GCP cloud platform is through a GCP Service Connector.
|
529 |
+
This is particularly useful if you are configuring ZenML stacks that combine the
|
530 |
+
GCP Image Builder with other remote stack components also running in GCP.
|
531 |
+
|
532 |
+
|
533 |
+
This method uses the implicit GCP authentication available in the environment
|
534 |
+
where the ZenML code is running. On your local machine, this is the quickest way
|
535 |
+
to configure a GCP Image Builder. You don''t need to supply credentials explicitly
|
536 |
+
when you register the GCP Image Builder, as it leverages the local credentials
|
537 |
+
and configuration that the Google Cloud CLI stores on your local machine. However,
|
538 |
+
you will need to install and set up the Google Cloud CLI on your machine as a
|
539 |
+
prerequisite, as covered in the Google Cloud documentation , before you register
|
540 |
+
the GCP Image Builder.
|
541 |
+
|
542 |
+
|
543 |
+
Stacks using the GCP Image Builder set up with local authentication are not portable
|
544 |
+
across environments. To make ZenML pipelines fully portable, it is recommended
|
545 |
+
to use a GCP Service Connector to authenticate your GCP Image Builder to the GCP
|
546 |
+
cloud platform.'
|
547 |
+
- source_sentence: How can ZenML load and display visualizations from the artifact
|
548 |
+
store?
|
549 |
+
sentences:
|
550 |
+
- 'Connect with a Service Account
|
551 |
+
|
552 |
+
|
553 |
+
Sometimes you may need to authenticate to a ZenML server from a non-interactive
|
554 |
+
environment where the web login is not possible, like a CI/CD workload or a serverless
|
555 |
+
function. In these cases, you can configure a service account and an API key and
|
556 |
+
use the API key to authenticate to the ZenML server:
|
557 |
+
|
558 |
+
|
559 |
+
zenml service-account create <SERVICE_ACCOUNT_NAME>
|
560 |
+
|
561 |
+
|
562 |
+
This command creates a service account and an API key for it. The API key is displayed
|
563 |
+
as part of the command output and cannot be retrieved later. You can then use
|
564 |
+
the issued API key to connect your ZenML client to the server through one of the
|
565 |
+
following methods:
|
566 |
+
|
567 |
+
|
568 |
+
using the CLI:
|
569 |
+
|
570 |
+
|
571 |
+
zenml connect --url https://... --api-key <API_KEY>
|
572 |
+
|
573 |
+
|
574 |
+
setting the ZENML_STORE_URL and ZENML_STORE_API_KEY environment variables when
|
575 |
+
you set up your ZenML client for the first time. This method is particularly useful
|
576 |
+
when you are using the ZenML client in an automated CI/CD workload environment
|
577 |
+
like GitHub Actions or GitLab CI or in a containerized environment like Docker
|
578 |
+
or Kubernetes:
|
579 |
+
|
580 |
+
|
581 |
+
export ZENML_STORE_URL=https://...
|
582 |
+
|
583 |
+
|
584 |
+
export ZENML_STORE_API_KEY=<API_KEY>
|
585 |
+
|
586 |
+
|
587 |
+
To see all the service accounts you''ve created and their API keys, use the following
|
588 |
+
commands:
|
589 |
+
|
590 |
+
|
591 |
+
zenml service-account list
|
592 |
+
|
593 |
+
|
594 |
+
zenml service-account api-key <SERVICE_ACCOUNT_NAME> list
|
595 |
+
|
596 |
+
|
597 |
+
Additionally, the following command allows you to more precisely inspect one of
|
598 |
+
these service accounts and an API key:
|
599 |
+
|
600 |
+
|
601 |
+
zenml service-account describe <SERVICE_ACCOUNT_NAME>
|
602 |
+
|
603 |
+
|
604 |
+
zenml service-account api-key <SERVICE_ACCOUNT_NAME> describe <API_KEY_NAME>
|
605 |
+
|
606 |
+
|
607 |
+
API keys don''t have an expiration date. For increased security, we recommend
|
608 |
+
that you regularly rotate the API keys to prevent unauthorized access to your
|
609 |
+
ZenML server. You can do this with the ZenML CLI:
|
610 |
+
|
611 |
+
|
612 |
+
zenml service-account api-key <SERVICE_ACCOUNT_NAME> rotate <API_KEY_NAME>'
|
613 |
+
- 'd_data_loader_step()
|
614 |
+
|
615 |
+
|
616 |
+
# Load the model to finetune# If no version is specified, the latest version of
|
617 |
+
"my_model" is used
|
618 |
+
|
619 |
+
|
620 |
+
model = client.get_artifact_version(
|
621 |
+
|
622 |
+
|
623 |
+
name_id_or_prefix="my_model", version=model_version
|
624 |
+
|
625 |
+
|
626 |
+
# Finetune the model
|
627 |
+
|
628 |
+
|
629 |
+
# This automatically creates a new version of "my_model"
|
630 |
+
|
631 |
+
|
632 |
+
model_finetuner_step(model=model, dataset=dataset)
|
633 |
+
|
634 |
+
|
635 |
+
def main():
|
636 |
+
|
637 |
+
|
638 |
+
# Save an untrained model as first version of "my_model"
|
639 |
+
|
640 |
+
|
641 |
+
untrained_model = SVC(gamma=0.001)
|
642 |
+
|
643 |
+
|
644 |
+
save_artifact(
|
645 |
+
|
646 |
+
|
647 |
+
untrained_model, name="my_model", version="1", tags=["SVC", "untrained"]
|
648 |
+
|
649 |
+
|
650 |
+
# Create a first version of "my_dataset" and train the model on it
|
651 |
+
|
652 |
+
|
653 |
+
model_finetuning_pipeline()
|
654 |
+
|
655 |
+
|
656 |
+
# Finetune the latest model on an older version of the dataset
|
657 |
+
|
658 |
+
|
659 |
+
model_finetuning_pipeline(dataset_version="1")
|
660 |
+
|
661 |
+
|
662 |
+
# Run inference with the latest model on an older version of the dataset
|
663 |
+
|
664 |
+
|
665 |
+
latest_trained_model = load_artifact("my_model")
|
666 |
+
|
667 |
+
|
668 |
+
old_dataset = load_artifact("my_dataset", version="1")
|
669 |
+
|
670 |
+
|
671 |
+
latest_trained_model.predict(old_dataset[0])
|
672 |
+
|
673 |
+
|
674 |
+
if __name__ == "__main__":
|
675 |
+
|
676 |
+
|
677 |
+
main()
|
678 |
+
|
679 |
+
|
680 |
+
This would create the following pipeline run DAGs:
|
681 |
+
|
682 |
+
|
683 |
+
Run 1:
|
684 |
+
|
685 |
+
|
686 |
+
Run 2:
|
687 |
+
|
688 |
+
|
689 |
+
PreviousCache previous executions
|
690 |
+
|
691 |
+
|
692 |
+
NextTrack ML models
|
693 |
+
|
694 |
+
|
695 |
+
Last updated 19 days ago'
|
696 |
+
- 'into play when the component is ultimately in use.The design behind this interaction
|
697 |
+
lets us separate the configuration of the flavor from its implementation. This
|
698 |
+
way we can register flavors and components even when the major dependencies behind
|
699 |
+
their implementation are not installed in our local setting (assuming the CustomArtifactStoreFlavor
|
700 |
+
and the CustomArtifactStoreConfig are implemented in a different module/path than
|
701 |
+
the actual CustomArtifactStore).
|
702 |
+
|
703 |
+
|
704 |
+
Enabling Artifact Visualizations with Custom Artifact Stores
|
705 |
+
|
706 |
+
|
707 |
+
ZenML automatically saves visualizations for many common data types and allows
|
708 |
+
you to view these visualizations in the ZenML dashboard. Under the hood, this
|
709 |
+
works by saving the visualizations together with the artifacts in the artifact
|
710 |
+
store.
|
711 |
+
|
712 |
+
|
713 |
+
In order to load and display these visualizations, ZenML needs to be able to load
|
714 |
+
and access the corresponding artifact store. This means that your custom artifact
|
715 |
+
store needs to be configured in a way that allows authenticating to the back-end
|
716 |
+
without relying on the local environment, e.g., by embedding the authentication
|
717 |
+
credentials in the stack component configuration or by referencing a secret.
|
718 |
+
|
719 |
+
|
720 |
+
Furthermore, for deployed ZenML instances, you need to install the package dependencies
|
721 |
+
of your artifact store implementation in the environment where you have deployed
|
722 |
+
ZenML. See the Documentation on deploying ZenML with custom Docker images for
|
723 |
+
more information on how to do that.
|
724 |
+
|
725 |
+
|
726 |
+
PreviousAzure Blob Storage
|
727 |
+
|
728 |
+
|
729 |
+
NextContainer Registries
|
730 |
+
|
731 |
+
|
732 |
+
Last updated 19 days ago'
|
733 |
+
- source_sentence: How do you configure ED25519 key based authentication for the HyperAI
|
734 |
+
orchestrator in ZenML?
|
735 |
+
sentences:
|
736 |
+
- 'authentication.
|
737 |
+
|
738 |
+
|
739 |
+
ED25519 key based authentication.SSH private keys configured in the connector
|
740 |
+
will be distributed to all clients that use them to run pipelines with the HyperAI
|
741 |
+
orchestrator. SSH keys are long-lived credentials that give unrestricted access
|
742 |
+
to HyperAI instances.
|
743 |
+
|
744 |
+
|
745 |
+
When configuring the Service Connector, it is required to provide at least one
|
746 |
+
hostname via hostnames and the username with which to login. Optionally, it is
|
747 |
+
possible to provide an ssh_passphrase if applicable. This way, it is possible
|
748 |
+
to use the HyperAI service connector in multiple ways:
|
749 |
+
|
750 |
+
|
751 |
+
Create one service connector per HyperAI instance with different SSH keys.
|
752 |
+
|
753 |
+
|
754 |
+
Configure a reused SSH key just once for multiple HyperAI instances, then select
|
755 |
+
the individual instance when creating the HyperAI orchestrator component.
|
756 |
+
|
757 |
+
|
758 |
+
Auto-configuration
|
759 |
+
|
760 |
+
|
761 |
+
This Service Connector does not support auto-discovery and extraction of authentication
|
762 |
+
credentials from HyperAI instances. If this feature is useful to you or your organization,
|
763 |
+
please let us know by messaging us in Slack or creating an issue on GitHub.
|
764 |
+
|
765 |
+
|
766 |
+
Stack Components use
|
767 |
+
|
768 |
+
|
769 |
+
The HyperAI Service Connector can be used by the HyperAI Orchestrator to deploy
|
770 |
+
pipeline runs to HyperAI instances.
|
771 |
+
|
772 |
+
|
773 |
+
PreviousAzure Service Connector
|
774 |
+
|
775 |
+
|
776 |
+
NextManage stacks
|
777 |
+
|
778 |
+
|
779 |
+
Last updated 15 days ago'
|
780 |
+
- 'nswer is satisfactory, or ''NO'' if it is not.",
|
781 |
+
|
782 |
+
|
783 |
+
},"role": "user",
|
784 |
+
|
785 |
+
|
786 |
+
"content": f"Question: {question}\nExpected Answer: {expected_answer}\nGenerated
|
787 |
+
Answer: {generated_answer}\nIs the generated answer relevant and accurate?",
|
788 |
+
|
789 |
+
|
790 |
+
},
|
791 |
+
|
792 |
+
|
793 |
+
],
|
794 |
+
|
795 |
+
|
796 |
+
model="gpt-3.5-turbo",
|
797 |
+
|
798 |
+
|
799 |
+
judgment = chat_completion.choices[0].message.content.strip().lower()
|
800 |
+
|
801 |
+
|
802 |
+
return judgment == "yes"
|
803 |
+
|
804 |
+
|
805 |
+
retrieval_scores = []
|
806 |
+
|
807 |
+
|
808 |
+
generation_scores = []
|
809 |
+
|
810 |
+
|
811 |
+
for item in eval_data:
|
812 |
+
|
813 |
+
|
814 |
+
retrieval_score = evaluate_retrieval(
|
815 |
+
|
816 |
+
|
817 |
+
item["question"], item["expected_answer"], corpus
|
818 |
+
|
819 |
+
|
820 |
+
retrieval_scores.append(retrieval_score)
|
821 |
+
|
822 |
+
|
823 |
+
generated_answer = answer_question(item["question"], corpus)
|
824 |
+
|
825 |
+
|
826 |
+
generation_score = evaluate_generation(
|
827 |
+
|
828 |
+
|
829 |
+
item["question"], item["expected_answer"], generated_answer
|
830 |
+
|
831 |
+
|
832 |
+
generation_scores.append(generation_score)
|
833 |
+
|
834 |
+
|
835 |
+
retrieval_accuracy = sum(retrieval_scores) / len(retrieval_scores)
|
836 |
+
|
837 |
+
|
838 |
+
generation_accuracy = sum(generation_scores) / len(generation_scores)
|
839 |
+
|
840 |
+
|
841 |
+
print(f"Retrieval Accuracy: {retrieval_accuracy:.2f}")
|
842 |
+
|
843 |
+
|
844 |
+
print(f"Generation Accuracy: {generation_accuracy:.2f}")
|
845 |
+
|
846 |
+
|
847 |
+
As you can see, we''ve added two evaluation functions: evaluate_retrieval and
|
848 |
+
evaluate_generation. The evaluate_retrieval function checks if the retrieved chunks
|
849 |
+
contain any words from the expected answer. The evaluate_generation function uses
|
850 |
+
OpenAI''s chat completion LLM to evaluate the quality of the generated answer.
|
851 |
+
|
852 |
+
|
853 |
+
We then loop through the evaluation data, which contains questions and expected
|
854 |
+
answers, and evaluate the retrieval and generation components of our RAG pipeline.
|
855 |
+
Finally, we calculate the accuracy of both components and print the results:
|
856 |
+
|
857 |
+
|
858 |
+
As you can see, we get 100% accuracy for both retrieval and generation in this
|
859 |
+
example. Not bad! The sections that follow will provide a more detailed and sophisticated
|
860 |
+
implementation of RAG evaluation, but this example shows how you can think about
|
861 |
+
it at a high level!
|
862 |
+
|
863 |
+
|
864 |
+
PreviousEvaluation and metrics
|
865 |
+
|
866 |
+
|
867 |
+
NextRetrieval evaluation
|
868 |
+
|
869 |
+
|
870 |
+
Last updated 19 days ago'
|
871 |
+
- ' have a look at the SDK docs .
|
872 |
+
|
873 |
+
|
874 |
+
How do you use it?To log information from a ZenML pipeline step using the Neptune
|
875 |
+
Experiment Tracker component in the active stack, you need to enable an experiment
|
876 |
+
tracker using the @step decorator. Then fetch the Neptune run object and use logging
|
877 |
+
capabilities as you would normally do. For example:
|
878 |
+
|
879 |
+
|
880 |
+
import numpy as np
|
881 |
+
|
882 |
+
|
883 |
+
import tensorflow as tf
|
884 |
+
|
885 |
+
|
886 |
+
from neptune_tensorflow_keras import NeptuneCallback
|
887 |
+
|
888 |
+
|
889 |
+
from zenml.integrations.neptune.experiment_trackers.run_state import (
|
890 |
+
|
891 |
+
|
892 |
+
get_neptune_run,
|
893 |
+
|
894 |
+
|
895 |
+
from zenml import step
|
896 |
+
|
897 |
+
|
898 |
+
@step(experiment_tracker="<NEPTUNE_TRACKER_STACK_COMPONENT_NAME>")
|
899 |
+
|
900 |
+
|
901 |
+
def tf_trainer(
|
902 |
+
|
903 |
+
|
904 |
+
x_train: np.ndarray,
|
905 |
+
|
906 |
+
|
907 |
+
y_train: np.ndarray,
|
908 |
+
|
909 |
+
|
910 |
+
x_val: np.ndarray,
|
911 |
+
|
912 |
+
|
913 |
+
y_val: np.ndarray,
|
914 |
+
|
915 |
+
|
916 |
+
epochs: int = 5,
|
917 |
+
|
918 |
+
|
919 |
+
lr: float = 0.001
|
920 |
+
|
921 |
+
|
922 |
+
) -> tf.keras.Model:
|
923 |
+
|
924 |
+
|
925 |
+
...
|
926 |
+
|
927 |
+
|
928 |
+
neptune_run = get_neptune_run()
|
929 |
+
|
930 |
+
|
931 |
+
model.fit(
|
932 |
+
|
933 |
+
|
934 |
+
x_train,
|
935 |
+
|
936 |
+
|
937 |
+
y_train,
|
938 |
+
|
939 |
+
|
940 |
+
epochs=epochs,
|
941 |
+
|
942 |
+
|
943 |
+
validation_data=(x_val, y_val),
|
944 |
+
|
945 |
+
|
946 |
+
callbacks=[
|
947 |
+
|
948 |
+
|
949 |
+
NeptuneCallback(run=neptune_run),
|
950 |
+
|
951 |
+
|
952 |
+
],
|
953 |
+
|
954 |
+
|
955 |
+
metric = ...
|
956 |
+
|
957 |
+
|
958 |
+
neptune_run["<METRIC_NAME>"] = metric
|
959 |
+
|
960 |
+
|
961 |
+
Instead of hardcoding an experiment tracker name, you can also use the Client
|
962 |
+
to dynamically use the experiment tracker of your active stack:
|
963 |
+
|
964 |
+
|
965 |
+
from zenml.client import Client
|
966 |
+
|
967 |
+
|
968 |
+
experiment_tracker = Client().active_stack.experiment_tracker
|
969 |
+
|
970 |
+
|
971 |
+
@step(experiment_tracker=experiment_tracker.name)
|
972 |
+
|
973 |
+
|
974 |
+
def tf_trainer(...):
|
975 |
+
|
976 |
+
|
977 |
+
...
|
978 |
+
|
979 |
+
|
980 |
+
Additional configuration
|
981 |
+
|
982 |
+
|
983 |
+
You can pass a set of tags to the Neptune run by using the NeptuneExperimentTrackerSettings
|
984 |
+
class, like in the example below:
|
985 |
+
|
986 |
+
|
987 |
+
import numpy as np
|
988 |
+
|
989 |
+
|
990 |
+
import tensorflow as tf
|
991 |
+
|
992 |
+
|
993 |
+
from zenml import step
|
994 |
+
|
995 |
+
|
996 |
+
from zenml.integrations.neptune.experiment_trackers.run_state import (
|
997 |
+
|
998 |
+
|
999 |
+
get_neptune_run,
|
1000 |
+
|
1001 |
+
|
1002 |
+
from zenml.integrations.neptune.flavors import NeptuneExperimentTrackerSettings
|
1003 |
+
|
1004 |
+
|
1005 |
+
neptune_settings = NeptuneExperimentTrackerSettings(tags={"keras", "mnist"})
|
1006 |
+
|
1007 |
+
|
1008 |
+
@step(
|
1009 |
+
|
1010 |
+
|
1011 |
+
experiment_tracker="<NEPTUNE_TRACKER_STACK_COMPONENT_NAME>",
|
1012 |
+
|
1013 |
+
|
1014 |
+
settings={
|
1015 |
+
|
1016 |
+
|
1017 |
+
"experiment_tracker.neptune": neptune_settings
|
1018 |
+
|
1019 |
+
|
1020 |
+
def my_step(
|
1021 |
+
|
1022 |
+
|
1023 |
+
x_test: np.ndarray,
|
1024 |
+
|
1025 |
+
|
1026 |
+
y_test: np.ndarray,
|
1027 |
+
|
1028 |
+
|
1029 |
+
model: tf.keras.Model,
|
1030 |
+
|
1031 |
+
|
1032 |
+
) -> float:
|
1033 |
+
|
1034 |
+
|
1035 |
+
"""Log metadata to Neptune run"""'
|
1036 |
+
model-index:
|
1037 |
+
- name: zenml/finetuned-all-MiniLM-L6-v2
|
1038 |
+
results:
|
1039 |
+
- task:
|
1040 |
+
type: information-retrieval
|
1041 |
+
name: Information Retrieval
|
1042 |
+
dataset:
|
1043 |
+
name: dim 384
|
1044 |
+
type: dim_384
|
1045 |
+
metrics:
|
1046 |
+
- type: cosine_accuracy@1
|
1047 |
+
value: 0.3313253012048193
|
1048 |
+
name: Cosine Accuracy@1
|
1049 |
+
- type: cosine_accuracy@3
|
1050 |
+
value: 0.5963855421686747
|
1051 |
+
name: Cosine Accuracy@3
|
1052 |
+
- type: cosine_accuracy@5
|
1053 |
+
value: 0.6867469879518072
|
1054 |
+
name: Cosine Accuracy@5
|
1055 |
+
- type: cosine_accuracy@10
|
1056 |
+
value: 0.8072289156626506
|
1057 |
+
name: Cosine Accuracy@10
|
1058 |
+
- type: cosine_precision@1
|
1059 |
+
value: 0.3313253012048193
|
1060 |
+
name: Cosine Precision@1
|
1061 |
+
- type: cosine_precision@3
|
1062 |
+
value: 0.1987951807228915
|
1063 |
+
name: Cosine Precision@3
|
1064 |
+
- type: cosine_precision@5
|
1065 |
+
value: 0.13734939759036144
|
1066 |
+
name: Cosine Precision@5
|
1067 |
+
- type: cosine_precision@10
|
1068 |
+
value: 0.08072289156626504
|
1069 |
+
name: Cosine Precision@10
|
1070 |
+
- type: cosine_recall@1
|
1071 |
+
value: 0.3313253012048193
|
1072 |
+
name: Cosine Recall@1
|
1073 |
+
- type: cosine_recall@3
|
1074 |
+
value: 0.5963855421686747
|
1075 |
+
name: Cosine Recall@3
|
1076 |
+
- type: cosine_recall@5
|
1077 |
+
value: 0.6867469879518072
|
1078 |
+
name: Cosine Recall@5
|
1079 |
+
- type: cosine_recall@10
|
1080 |
+
value: 0.8072289156626506
|
1081 |
+
name: Cosine Recall@10
|
1082 |
+
- type: cosine_ndcg@10
|
1083 |
+
value: 0.56403366334234
|
1084 |
+
name: Cosine Ndcg@10
|
1085 |
+
- type: cosine_mrr@10
|
1086 |
+
value: 0.48697408682348453
|
1087 |
+
name: Cosine Mrr@10
|
1088 |
+
- type: cosine_map@100
|
1089 |
+
value: 0.4930812678607045
|
1090 |
+
name: Cosine Map@100
|
1091 |
+
- task:
|
1092 |
+
type: information-retrieval
|
1093 |
+
name: Information Retrieval
|
1094 |
+
dataset:
|
1095 |
+
name: dim 256
|
1096 |
+
type: dim_256
|
1097 |
+
metrics:
|
1098 |
+
- type: cosine_accuracy@1
|
1099 |
+
value: 0.3373493975903614
|
1100 |
+
name: Cosine Accuracy@1
|
1101 |
+
- type: cosine_accuracy@3
|
1102 |
+
value: 0.5963855421686747
|
1103 |
+
name: Cosine Accuracy@3
|
1104 |
+
- type: cosine_accuracy@5
|
1105 |
+
value: 0.6746987951807228
|
1106 |
+
name: Cosine Accuracy@5
|
1107 |
+
- type: cosine_accuracy@10
|
1108 |
+
value: 0.7771084337349398
|
1109 |
+
name: Cosine Accuracy@10
|
1110 |
+
- type: cosine_precision@1
|
1111 |
+
value: 0.3373493975903614
|
1112 |
+
name: Cosine Precision@1
|
1113 |
+
- type: cosine_precision@3
|
1114 |
+
value: 0.1987951807228915
|
1115 |
+
name: Cosine Precision@3
|
1116 |
+
- type: cosine_precision@5
|
1117 |
+
value: 0.13493975903614455
|
1118 |
+
name: Cosine Precision@5
|
1119 |
+
- type: cosine_precision@10
|
1120 |
+
value: 0.07771084337349397
|
1121 |
+
name: Cosine Precision@10
|
1122 |
+
- type: cosine_recall@1
|
1123 |
+
value: 0.3373493975903614
|
1124 |
+
name: Cosine Recall@1
|
1125 |
+
- type: cosine_recall@3
|
1126 |
+
value: 0.5963855421686747
|
1127 |
+
name: Cosine Recall@3
|
1128 |
+
- type: cosine_recall@5
|
1129 |
+
value: 0.6746987951807228
|
1130 |
+
name: Cosine Recall@5
|
1131 |
+
- type: cosine_recall@10
|
1132 |
+
value: 0.7771084337349398
|
1133 |
+
name: Cosine Recall@10
|
1134 |
+
- type: cosine_ndcg@10
|
1135 |
+
value: 0.5551681743429259
|
1136 |
+
name: Cosine Ndcg@10
|
1137 |
+
- type: cosine_mrr@10
|
1138 |
+
value: 0.4842656339644293
|
1139 |
+
name: Cosine Mrr@10
|
1140 |
+
- type: cosine_map@100
|
1141 |
+
value: 0.4928559286742408
|
1142 |
+
name: Cosine Map@100
|
1143 |
+
- task:
|
1144 |
+
type: information-retrieval
|
1145 |
+
name: Information Retrieval
|
1146 |
+
dataset:
|
1147 |
+
name: dim 128
|
1148 |
+
type: dim_128
|
1149 |
+
metrics:
|
1150 |
+
- type: cosine_accuracy@1
|
1151 |
+
value: 0.3132530120481928
|
1152 |
+
name: Cosine Accuracy@1
|
1153 |
+
- type: cosine_accuracy@3
|
1154 |
+
value: 0.5060240963855421
|
1155 |
+
name: Cosine Accuracy@3
|
1156 |
+
- type: cosine_accuracy@5
|
1157 |
+
value: 0.5843373493975904
|
1158 |
+
name: Cosine Accuracy@5
|
1159 |
+
- type: cosine_accuracy@10
|
1160 |
+
value: 0.7289156626506024
|
1161 |
+
name: Cosine Accuracy@10
|
1162 |
+
- type: cosine_precision@1
|
1163 |
+
value: 0.3132530120481928
|
1164 |
+
name: Cosine Precision@1
|
1165 |
+
- type: cosine_precision@3
|
1166 |
+
value: 0.1686746987951807
|
1167 |
+
name: Cosine Precision@3
|
1168 |
+
- type: cosine_precision@5
|
1169 |
+
value: 0.11686746987951806
|
1170 |
+
name: Cosine Precision@5
|
1171 |
+
- type: cosine_precision@10
|
1172 |
+
value: 0.07289156626506023
|
1173 |
+
name: Cosine Precision@10
|
1174 |
+
- type: cosine_recall@1
|
1175 |
+
value: 0.3132530120481928
|
1176 |
+
name: Cosine Recall@1
|
1177 |
+
- type: cosine_recall@3
|
1178 |
+
value: 0.5060240963855421
|
1179 |
+
name: Cosine Recall@3
|
1180 |
+
- type: cosine_recall@5
|
1181 |
+
value: 0.5843373493975904
|
1182 |
+
name: Cosine Recall@5
|
1183 |
+
- type: cosine_recall@10
|
1184 |
+
value: 0.7289156626506024
|
1185 |
+
name: Cosine Recall@10
|
1186 |
+
- type: cosine_ndcg@10
|
1187 |
+
value: 0.5072091899807667
|
1188 |
+
name: Cosine Ndcg@10
|
1189 |
+
- type: cosine_mrr@10
|
1190 |
+
value: 0.43864744693057955
|
1191 |
+
name: Cosine Mrr@10
|
1192 |
+
- type: cosine_map@100
|
1193 |
+
value: 0.44825117444575807
|
1194 |
+
name: Cosine Map@100
|
1195 |
+
- task:
|
1196 |
+
type: information-retrieval
|
1197 |
+
name: Information Retrieval
|
1198 |
+
dataset:
|
1199 |
+
name: dim 64
|
1200 |
+
type: dim_64
|
1201 |
+
metrics:
|
1202 |
+
- type: cosine_accuracy@1
|
1203 |
+
value: 0.2469879518072289
|
1204 |
+
name: Cosine Accuracy@1
|
1205 |
+
- type: cosine_accuracy@3
|
1206 |
+
value: 0.4819277108433735
|
1207 |
+
name: Cosine Accuracy@3
|
1208 |
+
- type: cosine_accuracy@5
|
1209 |
+
value: 0.536144578313253
|
1210 |
+
name: Cosine Accuracy@5
|
1211 |
+
- type: cosine_accuracy@10
|
1212 |
+
value: 0.6506024096385542
|
1213 |
+
name: Cosine Accuracy@10
|
1214 |
+
- type: cosine_precision@1
|
1215 |
+
value: 0.2469879518072289
|
1216 |
+
name: Cosine Precision@1
|
1217 |
+
- type: cosine_precision@3
|
1218 |
+
value: 0.1606425702811245
|
1219 |
+
name: Cosine Precision@3
|
1220 |
+
- type: cosine_precision@5
|
1221 |
+
value: 0.10722891566265058
|
1222 |
+
name: Cosine Precision@5
|
1223 |
+
- type: cosine_precision@10
|
1224 |
+
value: 0.0650602409638554
|
1225 |
+
name: Cosine Precision@10
|
1226 |
+
- type: cosine_recall@1
|
1227 |
+
value: 0.2469879518072289
|
1228 |
+
name: Cosine Recall@1
|
1229 |
+
- type: cosine_recall@3
|
1230 |
+
value: 0.4819277108433735
|
1231 |
+
name: Cosine Recall@3
|
1232 |
+
- type: cosine_recall@5
|
1233 |
+
value: 0.536144578313253
|
1234 |
+
name: Cosine Recall@5
|
1235 |
+
- type: cosine_recall@10
|
1236 |
+
value: 0.6506024096385542
|
1237 |
+
name: Cosine Recall@10
|
1238 |
+
- type: cosine_ndcg@10
|
1239 |
+
value: 0.4454935545722587
|
1240 |
+
name: Cosine Ndcg@10
|
1241 |
+
- type: cosine_mrr@10
|
1242 |
+
value: 0.38048384012239445
|
1243 |
+
name: Cosine Mrr@10
|
1244 |
+
- type: cosine_map@100
|
1245 |
+
value: 0.39358543662682755
|
1246 |
+
name: Cosine Map@100
|
1247 |
+
---
|
1248 |
+
|
1249 |
+
# zenml/finetuned-all-MiniLM-L6-v2
|
1250 |
+
|
1251 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2). It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
1252 |
+
|
1253 |
+
## Model Details
|
1254 |
+
|
1255 |
+
### Model Description
|
1256 |
+
- **Model Type:** Sentence Transformer
|
1257 |
+
- **Base model:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) <!-- at revision 8b3219a92973c328a8e22fadcfa821b5dc75636a -->
|
1258 |
+
- **Maximum Sequence Length:** 256 tokens
|
1259 |
+
- **Output Dimensionality:** 384 tokens
|
1260 |
+
- **Similarity Function:** Cosine Similarity
|
1261 |
+
<!-- - **Training Dataset:** Unknown -->
|
1262 |
+
- **Language:** en
|
1263 |
+
- **License:** apache-2.0
|
1264 |
+
|
1265 |
+
### Model Sources
|
1266 |
+
|
1267 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
1268 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
1269 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
1270 |
+
|
1271 |
+
### Full Model Architecture
|
1272 |
+
|
1273 |
+
```
|
1274 |
+
SentenceTransformer(
|
1275 |
+
(0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: BertModel
|
1276 |
+
(1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
|
1277 |
+
(2): Normalize()
|
1278 |
+
)
|
1279 |
+
```
|
1280 |
+
|
1281 |
+
## Usage
|
1282 |
+
|
1283 |
+
### Direct Usage (Sentence Transformers)
|
1284 |
+
|
1285 |
+
First install the Sentence Transformers library:
|
1286 |
+
|
1287 |
+
```bash
|
1288 |
+
pip install -U sentence-transformers
|
1289 |
+
```
|
1290 |
+
|
1291 |
+
Then you can load this model and run inference.
|
1292 |
+
```python
|
1293 |
+
from sentence_transformers import SentenceTransformer
|
1294 |
+
|
1295 |
+
# Download from the 🤗 Hub
|
1296 |
+
model = SentenceTransformer("zenml/finetuned-all-MiniLM-L6-v2")
|
1297 |
+
# Run inference
|
1298 |
+
sentences = [
|
1299 |
+
'How do you configure ED25519 key based authentication for the HyperAI orchestrator in ZenML?',
|
1300 |
+
'authentication.\n\nED25519 key based authentication.SSH private keys configured in the connector will be distributed to all clients that use them to run pipelines with the HyperAI orchestrator. SSH keys are long-lived credentials that give unrestricted access to HyperAI instances.\n\nWhen configuring the Service Connector, it is required to provide at least one hostname via hostnames and the username with which to login. Optionally, it is possible to provide an ssh_passphrase if applicable. This way, it is possible to use the HyperAI service connector in multiple ways:\n\nCreate one service connector per HyperAI instance with different SSH keys.\n\nConfigure a reused SSH key just once for multiple HyperAI instances, then select the individual instance when creating the HyperAI orchestrator component.\n\nAuto-configuration\n\nThis Service Connector does not support auto-discovery and extraction of authentication credentials from HyperAI instances. If this feature is useful to you or your organization, please let us know by messaging us in Slack or creating an issue on GitHub.\n\nStack Components use\n\nThe HyperAI Service Connector can be used by the HyperAI Orchestrator to deploy pipeline runs to HyperAI instances.\n\nPreviousAzure Service Connector\n\nNextManage stacks\n\nLast updated 15 days ago',
|
1301 |
+
' have a look at the SDK docs .\n\nHow do you use it?To log information from a ZenML pipeline step using the Neptune Experiment Tracker component in the active stack, you need to enable an experiment tracker using the @step decorator. Then fetch the Neptune run object and use logging capabilities as you would normally do. For example:\n\nimport numpy as np\n\nimport tensorflow as tf\n\nfrom neptune_tensorflow_keras import NeptuneCallback\n\nfrom zenml.integrations.neptune.experiment_trackers.run_state import (\n\nget_neptune_run,\n\nfrom zenml import step\n\n@step(experiment_tracker="<NEPTUNE_TRACKER_STACK_COMPONENT_NAME>")\n\ndef tf_trainer(\n\nx_train: np.ndarray,\n\ny_train: np.ndarray,\n\nx_val: np.ndarray,\n\ny_val: np.ndarray,\n\nepochs: int = 5,\n\nlr: float = 0.001\n\n) -> tf.keras.Model:\n\n...\n\nneptune_run = get_neptune_run()\n\nmodel.fit(\n\nx_train,\n\ny_train,\n\nepochs=epochs,\n\nvalidation_data=(x_val, y_val),\n\ncallbacks=[\n\nNeptuneCallback(run=neptune_run),\n\n],\n\nmetric = ...\n\nneptune_run["<METRIC_NAME>"] = metric\n\nInstead of hardcoding an experiment tracker name, you can also use the Client to dynamically use the experiment tracker of your active stack:\n\nfrom zenml.client import Client\n\nexperiment_tracker = Client().active_stack.experiment_tracker\n\n@step(experiment_tracker=experiment_tracker.name)\n\ndef tf_trainer(...):\n\n...\n\nAdditional configuration\n\nYou can pass a set of tags to the Neptune run by using the NeptuneExperimentTrackerSettings class, like in the example below:\n\nimport numpy as np\n\nimport tensorflow as tf\n\nfrom zenml import step\n\nfrom zenml.integrations.neptune.experiment_trackers.run_state import (\n\nget_neptune_run,\n\nfrom zenml.integrations.neptune.flavors import NeptuneExperimentTrackerSettings\n\nneptune_settings = NeptuneExperimentTrackerSettings(tags={"keras", "mnist"})\n\n@step(\n\nexperiment_tracker="<NEPTUNE_TRACKER_STACK_COMPONENT_NAME>",\n\nsettings={\n\n"experiment_tracker.neptune": neptune_settings\n\ndef my_step(\n\nx_test: np.ndarray,\n\ny_test: np.ndarray,\n\nmodel: tf.keras.Model,\n\n) -> float:\n\n"""Log metadata to Neptune run"""',
|
1302 |
+
]
|
1303 |
+
embeddings = model.encode(sentences)
|
1304 |
+
print(embeddings.shape)
|
1305 |
+
# [3, 384]
|
1306 |
+
|
1307 |
+
# Get the similarity scores for the embeddings
|
1308 |
+
similarities = model.similarity(embeddings, embeddings)
|
1309 |
+
print(similarities.shape)
|
1310 |
+
# [3, 3]
|
1311 |
+
```
|
1312 |
+
|
1313 |
+
<!--
|
1314 |
+
### Direct Usage (Transformers)
|
1315 |
+
|
1316 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
1317 |
+
|
1318 |
+
</details>
|
1319 |
+
-->
|
1320 |
+
|
1321 |
+
<!--
|
1322 |
+
### Downstream Usage (Sentence Transformers)
|
1323 |
+
|
1324 |
+
You can finetune this model on your own dataset.
|
1325 |
+
|
1326 |
+
<details><summary>Click to expand</summary>
|
1327 |
+
|
1328 |
+
</details>
|
1329 |
+
-->
|
1330 |
+
|
1331 |
+
<!--
|
1332 |
+
### Out-of-Scope Use
|
1333 |
+
|
1334 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
1335 |
+
-->
|
1336 |
+
|
1337 |
+
## Evaluation
|
1338 |
+
|
1339 |
+
### Metrics
|
1340 |
+
|
1341 |
+
#### Information Retrieval
|
1342 |
+
* Dataset: `dim_384`
|
1343 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
|
1344 |
+
|
1345 |
+
| Metric | Value |
|
1346 |
+
|:--------------------|:-----------|
|
1347 |
+
| cosine_accuracy@1 | 0.3313 |
|
1348 |
+
| cosine_accuracy@3 | 0.5964 |
|
1349 |
+
| cosine_accuracy@5 | 0.6867 |
|
1350 |
+
| cosine_accuracy@10 | 0.8072 |
|
1351 |
+
| cosine_precision@1 | 0.3313 |
|
1352 |
+
| cosine_precision@3 | 0.1988 |
|
1353 |
+
| cosine_precision@5 | 0.1373 |
|
1354 |
+
| cosine_precision@10 | 0.0807 |
|
1355 |
+
| cosine_recall@1 | 0.3313 |
|
1356 |
+
| cosine_recall@3 | 0.5964 |
|
1357 |
+
| cosine_recall@5 | 0.6867 |
|
1358 |
+
| cosine_recall@10 | 0.8072 |
|
1359 |
+
| cosine_ndcg@10 | 0.564 |
|
1360 |
+
| cosine_mrr@10 | 0.487 |
|
1361 |
+
| **cosine_map@100** | **0.4931** |
|
1362 |
+
|
1363 |
+
#### Information Retrieval
|
1364 |
+
* Dataset: `dim_256`
|
1365 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
|
1366 |
+
|
1367 |
+
| Metric | Value |
|
1368 |
+
|:--------------------|:-----------|
|
1369 |
+
| cosine_accuracy@1 | 0.3373 |
|
1370 |
+
| cosine_accuracy@3 | 0.5964 |
|
1371 |
+
| cosine_accuracy@5 | 0.6747 |
|
1372 |
+
| cosine_accuracy@10 | 0.7771 |
|
1373 |
+
| cosine_precision@1 | 0.3373 |
|
1374 |
+
| cosine_precision@3 | 0.1988 |
|
1375 |
+
| cosine_precision@5 | 0.1349 |
|
1376 |
+
| cosine_precision@10 | 0.0777 |
|
1377 |
+
| cosine_recall@1 | 0.3373 |
|
1378 |
+
| cosine_recall@3 | 0.5964 |
|
1379 |
+
| cosine_recall@5 | 0.6747 |
|
1380 |
+
| cosine_recall@10 | 0.7771 |
|
1381 |
+
| cosine_ndcg@10 | 0.5552 |
|
1382 |
+
| cosine_mrr@10 | 0.4843 |
|
1383 |
+
| **cosine_map@100** | **0.4929** |
|
1384 |
+
|
1385 |
+
#### Information Retrieval
|
1386 |
+
* Dataset: `dim_128`
|
1387 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
|
1388 |
+
|
1389 |
+
| Metric | Value |
|
1390 |
+
|:--------------------|:-----------|
|
1391 |
+
| cosine_accuracy@1 | 0.3133 |
|
1392 |
+
| cosine_accuracy@3 | 0.506 |
|
1393 |
+
| cosine_accuracy@5 | 0.5843 |
|
1394 |
+
| cosine_accuracy@10 | 0.7289 |
|
1395 |
+
| cosine_precision@1 | 0.3133 |
|
1396 |
+
| cosine_precision@3 | 0.1687 |
|
1397 |
+
| cosine_precision@5 | 0.1169 |
|
1398 |
+
| cosine_precision@10 | 0.0729 |
|
1399 |
+
| cosine_recall@1 | 0.3133 |
|
1400 |
+
| cosine_recall@3 | 0.506 |
|
1401 |
+
| cosine_recall@5 | 0.5843 |
|
1402 |
+
| cosine_recall@10 | 0.7289 |
|
1403 |
+
| cosine_ndcg@10 | 0.5072 |
|
1404 |
+
| cosine_mrr@10 | 0.4386 |
|
1405 |
+
| **cosine_map@100** | **0.4483** |
|
1406 |
+
|
1407 |
+
#### Information Retrieval
|
1408 |
+
* Dataset: `dim_64`
|
1409 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
|
1410 |
+
|
1411 |
+
| Metric | Value |
|
1412 |
+
|:--------------------|:-----------|
|
1413 |
+
| cosine_accuracy@1 | 0.247 |
|
1414 |
+
| cosine_accuracy@3 | 0.4819 |
|
1415 |
+
| cosine_accuracy@5 | 0.5361 |
|
1416 |
+
| cosine_accuracy@10 | 0.6506 |
|
1417 |
+
| cosine_precision@1 | 0.247 |
|
1418 |
+
| cosine_precision@3 | 0.1606 |
|
1419 |
+
| cosine_precision@5 | 0.1072 |
|
1420 |
+
| cosine_precision@10 | 0.0651 |
|
1421 |
+
| cosine_recall@1 | 0.247 |
|
1422 |
+
| cosine_recall@3 | 0.4819 |
|
1423 |
+
| cosine_recall@5 | 0.5361 |
|
1424 |
+
| cosine_recall@10 | 0.6506 |
|
1425 |
+
| cosine_ndcg@10 | 0.4455 |
|
1426 |
+
| cosine_mrr@10 | 0.3805 |
|
1427 |
+
| **cosine_map@100** | **0.3936** |
|
1428 |
+
|
1429 |
+
<!--
|
1430 |
+
## Bias, Risks and Limitations
|
1431 |
+
|
1432 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
1433 |
+
-->
|
1434 |
+
|
1435 |
+
<!--
|
1436 |
+
### Recommendations
|
1437 |
+
|
1438 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
1439 |
+
-->
|
1440 |
+
|
1441 |
+
## Training Details
|
1442 |
+
|
1443 |
+
### Training Dataset
|
1444 |
+
|
1445 |
+
#### Unnamed Dataset
|
1446 |
+
|
1447 |
+
|
1448 |
+
* Size: 1,490 training samples
|
1449 |
+
* Columns: <code>positive</code> and <code>anchor</code>
|
1450 |
+
* Approximate statistics based on the first 1000 samples:
|
1451 |
+
| | positive | anchor |
|
1452 |
+
|:--------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|
|
1453 |
+
| type | string | string |
|
1454 |
+
| details | <ul><li>min: 9 tokens</li><li>mean: 21.22 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 21 tokens</li><li>mean: 239.53 tokens</li><li>max: 256 tokens</li></ul> |
|
1455 |
+
* Samples:
|
1456 |
+
| positive | anchor |
|
1457 |
+
|:------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
1458 |
+
| <code>What variables should be set for authenticating with the Azure Key Vault API when using ZenML?</code> | <code>-client-id","client_secret": "my-client-secret"}).Note: The remaining configuration options are deprecated and may be removed in a future release. Instead, you should set the ZENML_SECRETS_STORE_AUTH_METHOD and ZENML_SECRETS_STORE_AUTH_CONFIG variables to use the Azure Service Connector authentication method.<br><br>ZENML_SECRETS_STORE_AZURE_CLIENT_ID: The Azure application service principal client ID to use to authenticate with the Azure Key Vault API. If you are running the ZenML server hosted in Azure and are using a managed identity to access the Azure Key Vault service, you can omit this variable.<br><br>ZENML_SECRETS_STORE_AZURE_CLIENT_SECRET: The Azure application service principal client secret to use to authenticate with the Azure Key Vault API. If you are running the ZenML server hosted in Azure and are using a managed identity to access the Azure Key Vault service, you can omit this variable.<br><br>ZENML_SECRETS_STORE_AZURE_TENANT_ID: The Azure application service principal tenant ID to use to authenticate with the Azure Key Vault API. If you are running the ZenML server hosted in Azure and are using a managed identity to access the Azure Key Vault service, you can omit this variable.<br><br>These configuration options are only relevant if you're using Hashicorp Vault as the secrets store backend.<br><br>ZENML_SECRETS_STORE_TYPE: Set this to hashicorp in order to set this type of secret store.<br><br>ZENML_SECRETS_STORE_VAULT_ADDR: The URL of the HashiCorp Vault server to connect to. NOTE: this is the same as setting the VAULT_ADDR environment variable.<br><br>ZENML_SECRETS_STORE_VAULT_TOKEN: The token to use to authenticate with the HashiCorp Vault server. NOTE: this is the same as setting the VAULT_TOKEN environment variable.<br><br>ZENML_SECRETS_STORE_VAULT_NAMESPACE: The Vault Enterprise namespace. Not required for Vault OSS. NOTE: this is the same as setting the VAULT_NAMESPACE environment variable.</code> |
|
1459 |
+
| <code>How do I register and use the Azure Container Registry in ZenML?</code> | <code>Azure Container Registry<br><br>Storing container images in Azure.<br><br>The Azure container registry is a container registry flavor that comes built-in with ZenML and uses the Azure Container Registry to store container images.<br><br>When to use it<br><br>You should use the Azure container registry if:<br><br>one or more components of your stack need to pull or push container images.<br><br>you have access to Azure. If you're not using Azure, take a look at the other container registry flavors.<br><br>How to deploy it<br><br>Go here and choose a subscription, resource group, location, and registry name. Then click on Review + Create and to create your container registry.<br><br>How to find the registry URI<br><br>The Azure container registry URI should have the following format:<br><br><REGISTRY_NAME>.azurecr.io<br><br># Examples:<br><br>zenmlregistry.azurecr.io<br><br>myregistry.azurecr.io<br><br>To figure out the URI for your registry:<br><br>Go to the Azure portal.<br><br>In the search bar, enter container registries and select the container registry you want to use. If you don't have any container registries yet, check out the deployment section on how to create one.<br><br>Use the name of your registry to fill the template <REGISTRY_NAME>.azurecr.io and get your URI.<br><br>How to use it<br><br>To use the Azure container registry, we need:<br><br>Docker installed and running.<br><br>The registry URI. Check out the previous section on the URI format and how to get the URI for your registry.<br><br>We can then register the container registry and use it in our active stack:<br><br>zenml container-registry register <NAME> \<br><br>--flavor=azure \<br><br>--uri=<REGISTRY_URI><br><br># Add the container registry to the active stack<br><br>zenml stack update -c <NAME><br><br>You also need to set up authentication required to log in to the container registry.<br><br>Authentication Methods</code> |
|
1460 |
+
| <code>How can I create custom materializers in ZenML to handle specific serialization and deserialization logic?</code> | <code>s within a unique directory in the artifact store:Materializers are designed to be extensible and customizable, allowing you to define your own serialization and deserialization logic for specific data types or storage systems. By default, ZenML provides built-in materializers for common data types and uses cloudpickle to pickle objects where there is no default materializer. If you want direct control over how objects are serialized, you can easily create custom materializers by extending the BaseMaterializer class and implementing the required methods for your specific use case. Read more about materializers here.<br><br>ZenML provides a built-in CloudpickleMaterializer that can handle any object by saving it with cloudpickle. However, this is not production-ready because the resulting artifacts cannot be loaded when running with a different Python version. In such cases, you should consider building a custom Materializer to save your objects in a more robust and efficient format.<br><br>Moreover, using the CloudpickleMaterializer could allow users to upload of any kind of object. This could be exploited to upload a malicious file, which could execute arbitrary code on the vulnerable system.<br><br>When a pipeline runs, ZenML uses the appropriate materializers to save and load artifacts using the ZenML fileio system (built to work across multiple artifact stores). This not only simplifies the process of working with different data formats and storage systems but also enables artifact caching and lineage tracking. You can see an example of a default materializer (the numpy materializer) in action here.<br><br>PreviousHandle Data/Artifacts<br><br>NextReturn multiple outputs from a step<br><br>Last updated 15 days ago</code> |
|
1461 |
+
* Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
|
1462 |
+
```json
|
1463 |
+
{
|
1464 |
+
"loss": "MultipleNegativesRankingLoss",
|
1465 |
+
"matryoshka_dims": [
|
1466 |
+
384,
|
1467 |
+
256,
|
1468 |
+
128,
|
1469 |
+
64
|
1470 |
+
],
|
1471 |
+
"matryoshka_weights": [
|
1472 |
+
1,
|
1473 |
+
1,
|
1474 |
+
1,
|
1475 |
+
1
|
1476 |
+
],
|
1477 |
+
"n_dims_per_step": -1
|
1478 |
+
}
|
1479 |
+
```
|
1480 |
+
|
1481 |
+
### Training Hyperparameters
|
1482 |
+
#### Non-Default Hyperparameters
|
1483 |
+
|
1484 |
+
- `eval_strategy`: epoch
|
1485 |
+
- `per_device_train_batch_size`: 32
|
1486 |
+
- `per_device_eval_batch_size`: 16
|
1487 |
+
- `gradient_accumulation_steps`: 16
|
1488 |
+
- `learning_rate`: 2e-05
|
1489 |
+
- `num_train_epochs`: 4
|
1490 |
+
- `lr_scheduler_type`: cosine
|
1491 |
+
- `warmup_ratio`: 0.1
|
1492 |
+
- `bf16`: True
|
1493 |
+
- `tf32`: True
|
1494 |
+
- `load_best_model_at_end`: True
|
1495 |
+
- `optim`: adamw_torch_fused
|
1496 |
+
- `batch_sampler`: no_duplicates
|
1497 |
+
|
1498 |
+
#### All Hyperparameters
|
1499 |
+
<details><summary>Click to expand</summary>
|
1500 |
+
|
1501 |
+
- `overwrite_output_dir`: False
|
1502 |
+
- `do_predict`: False
|
1503 |
+
- `eval_strategy`: epoch
|
1504 |
+
- `prediction_loss_only`: True
|
1505 |
+
- `per_device_train_batch_size`: 32
|
1506 |
+
- `per_device_eval_batch_size`: 16
|
1507 |
+
- `per_gpu_train_batch_size`: None
|
1508 |
+
- `per_gpu_eval_batch_size`: None
|
1509 |
+
- `gradient_accumulation_steps`: 16
|
1510 |
+
- `eval_accumulation_steps`: None
|
1511 |
+
- `learning_rate`: 2e-05
|
1512 |
+
- `weight_decay`: 0.0
|
1513 |
+
- `adam_beta1`: 0.9
|
1514 |
+
- `adam_beta2`: 0.999
|
1515 |
+
- `adam_epsilon`: 1e-08
|
1516 |
+
- `max_grad_norm`: 1.0
|
1517 |
+
- `num_train_epochs`: 4
|
1518 |
+
- `max_steps`: -1
|
1519 |
+
- `lr_scheduler_type`: cosine
|
1520 |
+
- `lr_scheduler_kwargs`: {}
|
1521 |
+
- `warmup_ratio`: 0.1
|
1522 |
+
- `warmup_steps`: 0
|
1523 |
+
- `log_level`: passive
|
1524 |
+
- `log_level_replica`: warning
|
1525 |
+
- `log_on_each_node`: True
|
1526 |
+
- `logging_nan_inf_filter`: True
|
1527 |
+
- `save_safetensors`: True
|
1528 |
+
- `save_on_each_node`: False
|
1529 |
+
- `save_only_model`: False
|
1530 |
+
- `restore_callback_states_from_checkpoint`: False
|
1531 |
+
- `no_cuda`: False
|
1532 |
+
- `use_cpu`: False
|
1533 |
+
- `use_mps_device`: False
|
1534 |
+
- `seed`: 42
|
1535 |
+
- `data_seed`: None
|
1536 |
+
- `jit_mode_eval`: False
|
1537 |
+
- `use_ipex`: False
|
1538 |
+
- `bf16`: True
|
1539 |
+
- `fp16`: False
|
1540 |
+
- `fp16_opt_level`: O1
|
1541 |
+
- `half_precision_backend`: auto
|
1542 |
+
- `bf16_full_eval`: False
|
1543 |
+
- `fp16_full_eval`: False
|
1544 |
+
- `tf32`: True
|
1545 |
+
- `local_rank`: 0
|
1546 |
+
- `ddp_backend`: None
|
1547 |
+
- `tpu_num_cores`: None
|
1548 |
+
- `tpu_metrics_debug`: False
|
1549 |
+
- `debug`: []
|
1550 |
+
- `dataloader_drop_last`: False
|
1551 |
+
- `dataloader_num_workers`: 0
|
1552 |
+
- `dataloader_prefetch_factor`: None
|
1553 |
+
- `past_index`: -1
|
1554 |
+
- `disable_tqdm`: True
|
1555 |
+
- `remove_unused_columns`: True
|
1556 |
+
- `label_names`: None
|
1557 |
+
- `load_best_model_at_end`: True
|
1558 |
+
- `ignore_data_skip`: False
|
1559 |
+
- `fsdp`: []
|
1560 |
+
- `fsdp_min_num_params`: 0
|
1561 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
1562 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
1563 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
1564 |
+
- `deepspeed`: None
|
1565 |
+
- `label_smoothing_factor`: 0.0
|
1566 |
+
- `optim`: adamw_torch_fused
|
1567 |
+
- `optim_args`: None
|
1568 |
+
- `adafactor`: False
|
1569 |
+
- `group_by_length`: False
|
1570 |
+
- `length_column_name`: length
|
1571 |
+
- `ddp_find_unused_parameters`: None
|
1572 |
+
- `ddp_bucket_cap_mb`: None
|
1573 |
+
- `ddp_broadcast_buffers`: False
|
1574 |
+
- `dataloader_pin_memory`: True
|
1575 |
+
- `dataloader_persistent_workers`: False
|
1576 |
+
- `skip_memory_metrics`: True
|
1577 |
+
- `use_legacy_prediction_loop`: False
|
1578 |
+
- `push_to_hub`: False
|
1579 |
+
- `resume_from_checkpoint`: None
|
1580 |
+
- `hub_model_id`: None
|
1581 |
+
- `hub_strategy`: every_save
|
1582 |
+
- `hub_private_repo`: False
|
1583 |
+
- `hub_always_push`: False
|
1584 |
+
- `gradient_checkpointing`: False
|
1585 |
+
- `gradient_checkpointing_kwargs`: None
|
1586 |
+
- `include_inputs_for_metrics`: False
|
1587 |
+
- `eval_do_concat_batches`: True
|
1588 |
+
- `fp16_backend`: auto
|
1589 |
+
- `push_to_hub_model_id`: None
|
1590 |
+
- `push_to_hub_organization`: None
|
1591 |
+
- `mp_parameters`:
|
1592 |
+
- `auto_find_batch_size`: False
|
1593 |
+
- `full_determinism`: False
|
1594 |
+
- `torchdynamo`: None
|
1595 |
+
- `ray_scope`: last
|
1596 |
+
- `ddp_timeout`: 1800
|
1597 |
+
- `torch_compile`: False
|
1598 |
+
- `torch_compile_backend`: None
|
1599 |
+
- `torch_compile_mode`: None
|
1600 |
+
- `dispatch_batches`: None
|
1601 |
+
- `split_batches`: None
|
1602 |
+
- `include_tokens_per_second`: False
|
1603 |
+
- `include_num_input_tokens_seen`: False
|
1604 |
+
- `neftune_noise_alpha`: None
|
1605 |
+
- `optim_target_modules`: None
|
1606 |
+
- `batch_eval_metrics`: False
|
1607 |
+
- `batch_sampler`: no_duplicates
|
1608 |
+
- `multi_dataset_batch_sampler`: proportional
|
1609 |
+
|
1610 |
+
</details>
|
1611 |
+
|
1612 |
+
### Training Logs
|
1613 |
+
| Epoch | Step | dim_128_cosine_map@100 | dim_256_cosine_map@100 | dim_384_cosine_map@100 | dim_64_cosine_map@100 |
|
1614 |
+
|:----------:|:-----:|:----------------------:|:----------------------:|:----------------------:|:---------------------:|
|
1615 |
+
| 0.6667 | 1 | 0.4136 | 0.4596 | 0.4702 | 0.3613 |
|
1616 |
+
| 2.0 | 3 | 0.4385 | 0.4910 | 0.4922 | 0.3873 |
|
1617 |
+
| **2.6667** | **4** | **0.4483** | **0.4929** | **0.4931** | **0.3936** |
|
1618 |
+
|
1619 |
+
* The bold row denotes the saved checkpoint.
|
1620 |
+
|
1621 |
+
### Framework Versions
|
1622 |
+
- Python: 3.10.14
|
1623 |
+
- Sentence Transformers: 3.0.1
|
1624 |
+
- Transformers: 4.41.2
|
1625 |
+
- PyTorch: 2.3.1+cu121
|
1626 |
+
- Accelerate: 0.31.0
|
1627 |
+
- Datasets: 2.19.1
|
1628 |
+
- Tokenizers: 0.19.1
|
1629 |
+
|
1630 |
+
## Citation
|
1631 |
+
|
1632 |
+
### BibTeX
|
1633 |
+
|
1634 |
+
#### Sentence Transformers
|
1635 |
+
```bibtex
|
1636 |
+
@inproceedings{reimers-2019-sentence-bert,
|
1637 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
1638 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
1639 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
1640 |
+
month = "11",
|
1641 |
+
year = "2019",
|
1642 |
+
publisher = "Association for Computational Linguistics",
|
1643 |
+
url = "https://arxiv.org/abs/1908.10084",
|
1644 |
+
}
|
1645 |
+
```
|
1646 |
+
|
1647 |
+
#### MatryoshkaLoss
|
1648 |
+
```bibtex
|
1649 |
+
@misc{kusupati2024matryoshka,
|
1650 |
+
title={Matryoshka Representation Learning},
|
1651 |
+
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},
|
1652 |
+
year={2024},
|
1653 |
+
eprint={2205.13147},
|
1654 |
+
archivePrefix={arXiv},
|
1655 |
+
primaryClass={cs.LG}
|
1656 |
+
}
|
1657 |
+
```
|
1658 |
+
|
1659 |
+
#### MultipleNegativesRankingLoss
|
1660 |
+
```bibtex
|
1661 |
+
@misc{henderson2017efficient,
|
1662 |
+
title={Efficient Natural Language Response Suggestion for Smart Reply},
|
1663 |
+
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},
|
1664 |
+
year={2017},
|
1665 |
+
eprint={1705.00652},
|
1666 |
+
archivePrefix={arXiv},
|
1667 |
+
primaryClass={cs.CL}
|
1668 |
+
}
|
1669 |
+
```
|
1670 |
+
|
1671 |
+
<!--
|
1672 |
+
## Glossary
|
1673 |
+
|
1674 |
+
*Clearly define terms in order to be accessible across audiences.*
|
1675 |
+
-->
|
1676 |
+
|
1677 |
+
<!--
|
1678 |
+
## Model Card Authors
|
1679 |
+
|
1680 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
1681 |
+
-->
|
1682 |
+
|
1683 |
+
<!--
|
1684 |
+
## Model Card Contact
|
1685 |
+
|
1686 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
1687 |
+
-->
|
config.json
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "sentence-transformers/all-MiniLM-L6-v2",
|
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": 384,
|
12 |
+
"initializer_range": 0.02,
|
13 |
+
"intermediate_size": 1536,
|
14 |
+
"layer_norm_eps": 1e-12,
|
15 |
+
"max_position_embeddings": 512,
|
16 |
+
"model_type": "bert",
|
17 |
+
"num_attention_heads": 12,
|
18 |
+
"num_hidden_layers": 6,
|
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,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"__version__": {
|
3 |
+
"sentence_transformers": "3.0.1",
|
4 |
+
"transformers": "4.41.2",
|
5 |
+
"pytorch": "2.3.1+cu121"
|
6 |
+
},
|
7 |
+
"prompts": {},
|
8 |
+
"default_prompt_name": null,
|
9 |
+
"similarity_fn_name": null
|
10 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0d51cb2eb22028b3cd2bff6e6148b927a430ed64a2ac19b856425535081b6177
|
3 |
+
size 90864192
|
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": 256,
|
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,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_basic_tokenize": true,
|
47 |
+
"do_lower_case": true,
|
48 |
+
"mask_token": "[MASK]",
|
49 |
+
"max_length": 128,
|
50 |
+
"model_max_length": 256,
|
51 |
+
"never_split": null,
|
52 |
+
"pad_to_multiple_of": null,
|
53 |
+
"pad_token": "[PAD]",
|
54 |
+
"pad_token_type_id": 0,
|
55 |
+
"padding_side": "right",
|
56 |
+
"sep_token": "[SEP]",
|
57 |
+
"stride": 0,
|
58 |
+
"strip_accents": null,
|
59 |
+
"tokenize_chinese_chars": true,
|
60 |
+
"tokenizer_class": "BertTokenizer",
|
61 |
+
"truncation_side": "right",
|
62 |
+
"truncation_strategy": "longest_first",
|
63 |
+
"unk_token": "[UNK]"
|
64 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|