Add new SentenceTransformer model.
Browse files- 1_Pooling/config.json +10 -0
- README.md +1699 -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,1699 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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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: How can I configure the orchestrator settings for each cloud provider
|
35 |
+
in ZenML?
|
36 |
+
sentences:
|
37 |
+
- '. If not set, the cluster will not be autostopped.down: Tear down the cluster
|
38 |
+
after all jobs finish (successfully or abnormally). If idle_minutes_to_autostop
|
39 |
+
is also set, the cluster will be torn down after the specified idle time. Note
|
40 |
+
that if errors occur during provisioning/data syncing/setting up, the cluster
|
41 |
+
will not be torn down for debugging purposes.
|
42 |
+
|
43 |
+
|
44 |
+
stream_logs: If True, show the logs in the terminal as they are generated while
|
45 |
+
the cluster is running.
|
46 |
+
|
47 |
+
|
48 |
+
docker_run_args: Additional arguments to pass to the docker run command. For example,
|
49 |
+
[''--gpus=all''] to use all GPUs available on the VM.
|
50 |
+
|
51 |
+
|
52 |
+
The following code snippets show how to configure the orchestrator settings for
|
53 |
+
each cloud provider:
|
54 |
+
|
55 |
+
|
56 |
+
Code Example:
|
57 |
+
|
58 |
+
|
59 |
+
from zenml.integrations.skypilot_aws.flavors.skypilot_orchestrator_aws_vm_flavor
|
60 |
+
import SkypilotAWSOrchestratorSettings
|
61 |
+
|
62 |
+
|
63 |
+
skypilot_settings = SkypilotAWSOrchestratorSettings(
|
64 |
+
|
65 |
+
|
66 |
+
cpus="2",
|
67 |
+
|
68 |
+
|
69 |
+
memory="16",
|
70 |
+
|
71 |
+
|
72 |
+
accelerators="V100:2",
|
73 |
+
|
74 |
+
|
75 |
+
accelerator_args={"tpu_vm": True, "runtime_version": "tpu-vm-base"},
|
76 |
+
|
77 |
+
|
78 |
+
use_spot=True,
|
79 |
+
|
80 |
+
|
81 |
+
spot_recovery="recovery_strategy",
|
82 |
+
|
83 |
+
|
84 |
+
region="us-west-1",
|
85 |
+
|
86 |
+
|
87 |
+
zone="us-west1-a",
|
88 |
+
|
89 |
+
|
90 |
+
image_id="ami-1234567890abcdef0",
|
91 |
+
|
92 |
+
|
93 |
+
disk_size=100,
|
94 |
+
|
95 |
+
|
96 |
+
disk_tier="high",
|
97 |
+
|
98 |
+
|
99 |
+
cluster_name="my_cluster",
|
100 |
+
|
101 |
+
|
102 |
+
retry_until_up=True,
|
103 |
+
|
104 |
+
|
105 |
+
idle_minutes_to_autostop=60,
|
106 |
+
|
107 |
+
|
108 |
+
down=True,
|
109 |
+
|
110 |
+
|
111 |
+
stream_logs=True
|
112 |
+
|
113 |
+
|
114 |
+
docker_run_args=["--gpus=all"]
|
115 |
+
|
116 |
+
|
117 |
+
@pipeline(
|
118 |
+
|
119 |
+
|
120 |
+
settings={
|
121 |
+
|
122 |
+
|
123 |
+
"orchestrator.vm_aws": skypilot_settings
|
124 |
+
|
125 |
+
|
126 |
+
Code Example:
|
127 |
+
|
128 |
+
|
129 |
+
from zenml.integrations.skypilot_gcp.flavors.skypilot_orchestrator_gcp_vm_flavor
|
130 |
+
import SkypilotGCPOrchestratorSettings
|
131 |
+
|
132 |
+
|
133 |
+
skypilot_settings = SkypilotGCPOrchestratorSettings(
|
134 |
+
|
135 |
+
|
136 |
+
cpus="2",
|
137 |
+
|
138 |
+
|
139 |
+
memory="16",
|
140 |
+
|
141 |
+
|
142 |
+
accelerators="V100:2",
|
143 |
+
|
144 |
+
|
145 |
+
accelerator_args={"tpu_vm": True, "runtime_version": "tpu-vm-base"},
|
146 |
+
|
147 |
+
|
148 |
+
use_spot=True,
|
149 |
+
|
150 |
+
|
151 |
+
spot_recovery="recovery_strategy",
|
152 |
+
|
153 |
+
|
154 |
+
region="us-west1",
|
155 |
+
|
156 |
+
|
157 |
+
zone="us-west1-a",
|
158 |
+
|
159 |
+
|
160 |
+
image_id="ubuntu-pro-2004-focal-v20231101",
|
161 |
+
|
162 |
+
|
163 |
+
disk_size=100,
|
164 |
+
|
165 |
+
|
166 |
+
disk_tier="high",
|
167 |
+
|
168 |
+
|
169 |
+
cluster_name="my_cluster",
|
170 |
+
|
171 |
+
|
172 |
+
retry_until_up=True,
|
173 |
+
|
174 |
+
|
175 |
+
idle_minutes_to_autostop=60,
|
176 |
+
|
177 |
+
|
178 |
+
down=True,
|
179 |
+
|
180 |
+
|
181 |
+
stream_logs=True
|
182 |
+
|
183 |
+
|
184 |
+
@pipeline(
|
185 |
+
|
186 |
+
|
187 |
+
settings={
|
188 |
+
|
189 |
+
|
190 |
+
"orchestrator.vm_gcp": skypilot_settings'
|
191 |
+
- 'he Post-execution workflow has changed as follows:The get_pipelines and get_pipeline
|
192 |
+
methods have been moved out of the Repository (i.e. the new Client ) class and
|
193 |
+
lie directly in the post_execution module now. To use the user has to do:
|
194 |
+
|
195 |
+
|
196 |
+
from zenml.post_execution import get_pipelines, get_pipeline
|
197 |
+
|
198 |
+
|
199 |
+
New methods to directly get a run have been introduced: get_run and get_unlisted_runs
|
200 |
+
method has been introduced to get unlisted runs.
|
201 |
+
|
202 |
+
|
203 |
+
Usage remains largely similar. Please read the new docs for post-execution to
|
204 |
+
inform yourself of what further has changed.
|
205 |
+
|
206 |
+
|
207 |
+
How to migrate: Replace all post-execution workflows from the paradigm of Repository.get_pipelines
|
208 |
+
or Repository.get_pipeline_run to the corresponding post_execution methods.
|
209 |
+
|
210 |
+
|
211 |
+
π‘Future Changes
|
212 |
+
|
213 |
+
|
214 |
+
While this rehaul is big and will break previous releases, we do have some more
|
215 |
+
work left to do. However we also expect this to be the last big rehaul of ZenML
|
216 |
+
before our 1.0.0 release, and no other release will be so hard breaking as this
|
217 |
+
one. Currently planned future breaking changes are:
|
218 |
+
|
219 |
+
|
220 |
+
Following the metadata store, the secrets manager stack component might move out
|
221 |
+
of the stack.
|
222 |
+
|
223 |
+
|
224 |
+
ZenML StepContext might be deprecated.
|
225 |
+
|
226 |
+
|
227 |
+
π Reporting Bugs
|
228 |
+
|
229 |
+
|
230 |
+
While we have tried our best to document everything that has changed, we realize
|
231 |
+
that mistakes can be made and smaller changes overlooked. If this is the case,
|
232 |
+
or you encounter a bug at any time, the ZenML core team and community are available
|
233 |
+
around the clock on the growing Slack community.
|
234 |
+
|
235 |
+
|
236 |
+
For bug reports, please also consider submitting a GitHub Issue.
|
237 |
+
|
238 |
+
|
239 |
+
Lastly, if the new changes have left you desiring a feature, then consider adding
|
240 |
+
it to our public feature voting board. Before doing so, do check what is already
|
241 |
+
on there and consider upvoting the features you desire the most.
|
242 |
+
|
243 |
+
|
244 |
+
PreviousMigration guide
|
245 |
+
|
246 |
+
|
247 |
+
NextMigration guide 0.23.0 β 0.30.0
|
248 |
+
|
249 |
+
|
250 |
+
Last updated 12 days ago'
|
251 |
+
- 'nML, namely an orchestrator and an artifact store.Keep in mind, that each one
|
252 |
+
of these components is built on top of base abstractions and is completely extensible.
|
253 |
+
|
254 |
+
|
255 |
+
Orchestrator
|
256 |
+
|
257 |
+
|
258 |
+
An Orchestrator is a workhorse that coordinates all the steps to run in a pipeline.
|
259 |
+
Since pipelines can be set up with complex combinations of steps with various
|
260 |
+
asynchronous dependencies between them, the orchestrator acts as the component
|
261 |
+
that decides what steps to run and when to run them.
|
262 |
+
|
263 |
+
|
264 |
+
ZenML comes with a default local orchestrator designed to run on your local machine.
|
265 |
+
This is useful, especially during the exploration phase of your project. You don''t
|
266 |
+
have to rent a cloud instance just to try out basic things.
|
267 |
+
|
268 |
+
|
269 |
+
Artifact Store
|
270 |
+
|
271 |
+
|
272 |
+
An Artifact Store is a component that houses all data that pass through the pipeline
|
273 |
+
as inputs and outputs. Each artifact that gets stored in the artifact store is
|
274 |
+
tracked and versioned and this allows for extremely useful features like data
|
275 |
+
caching which speeds up your workflows.
|
276 |
+
|
277 |
+
|
278 |
+
Similar to the orchestrator, ZenML comes with a default local artifact store designed
|
279 |
+
to run on your local machine. This is useful, especially during the exploration
|
280 |
+
phase of your project. You don''t have to set up a cloud storage system to try
|
281 |
+
out basic things.
|
282 |
+
|
283 |
+
|
284 |
+
Flavor
|
285 |
+
|
286 |
+
|
287 |
+
ZenML provides a dedicated base abstraction for each stack component type. These
|
288 |
+
abstractions are used to develop solutions, called Flavors, tailored to specific
|
289 |
+
use cases/tools. With ZenML installed, you get access to a variety of built-in
|
290 |
+
and integrated Flavors for each component type, but users can also leverage the
|
291 |
+
base abstractions to create their own custom flavors.
|
292 |
+
|
293 |
+
|
294 |
+
Stack Switching
|
295 |
+
|
296 |
+
|
297 |
+
When it comes to production-grade solutions, it is rarely enough to just run your
|
298 |
+
workflow locally without including any cloud infrastructure.'
|
299 |
+
- source_sentence: How can I fetch artifacts from other pipelines within a step using
|
300 |
+
ZenML?
|
301 |
+
sentences:
|
302 |
+
- ' ββ βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨
|
303 |
+
|
304 |
+
|
305 |
+
β EXPIRES IN β N/A β
|
306 |
+
|
307 |
+
|
308 |
+
β βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨
|
309 |
+
|
310 |
+
|
311 |
+
β OWNER β default β
|
312 |
+
|
313 |
+
|
314 |
+
β βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨
|
315 |
+
|
316 |
+
|
317 |
+
β WORKSPACE β default β
|
318 |
+
|
319 |
+
|
320 |
+
β βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨
|
321 |
+
|
322 |
+
|
323 |
+
β SHARED β β β
|
324 |
+
|
325 |
+
|
326 |
+
β βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨
|
327 |
+
|
328 |
+
|
329 |
+
β CREATED_AT β 2023-05-19 09:15:12.882929 β
|
330 |
+
|
331 |
+
|
332 |
+
β βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨
|
333 |
+
|
334 |
+
|
335 |
+
β UPDATED_AT β 2023-05-19 09:15:12.882930 β
|
336 |
+
|
337 |
+
|
338 |
+
ββββββββββββββββββββ·βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
339 |
+
|
340 |
+
|
341 |
+
Configuration
|
342 |
+
|
343 |
+
|
344 |
+
βββββββββββββββββββββ―βββββββββββββ
|
345 |
+
|
346 |
+
|
347 |
+
β PROPERTY β VALUE β
|
348 |
+
|
349 |
+
|
350 |
+
β ββββββββββββββββββββΌβββββββββββββ¨
|
351 |
+
|
352 |
+
|
353 |
+
β project_id β zenml-core β
|
354 |
+
|
355 |
+
|
356 |
+
β ββββββββββββββββββββΌβββββββββββββ¨
|
357 |
+
|
358 |
+
|
359 |
+
β user_account_json β [HIDDEN] β
|
360 |
+
|
361 |
+
|
362 |
+
βββββββββββββββββββββ·βββββββββββββ
|
363 |
+
|
364 |
+
|
365 |
+
Local client provisioning
|
366 |
+
|
367 |
+
|
368 |
+
The local gcloud CLI, the Kubernetes kubectl CLI and the Docker CLI can be configured
|
369 |
+
with credentials extracted from or generated by a compatible GCP Service Connector.
|
370 |
+
Please note that unlike the configuration made possible through the GCP CLI, the
|
371 |
+
Kubernetes and Docker credentials issued by the GCP Service Connector have a short
|
372 |
+
lifetime and will need to be regularly refreshed. This is a byproduct of implementing
|
373 |
+
a high-security profile.'
|
374 |
+
- 'gmax(prediction.numpy())
|
375 |
+
|
376 |
+
|
377 |
+
return classes[maxindex]The custom predict function should get the model and the
|
378 |
+
input data as arguments and return the model predictions. ZenML will automatically
|
379 |
+
take care of loading the model into memory and starting the seldon-core-microservice
|
380 |
+
that will be responsible for serving the model and running the predict function.
|
381 |
+
|
382 |
+
|
383 |
+
After defining your custom predict function in code, you can use the seldon_custom_model_deployer_step
|
384 |
+
to automatically build your function into a Docker image and deploy it as a model
|
385 |
+
server by setting the predict_function argument to the path of your custom_predict
|
386 |
+
function:
|
387 |
+
|
388 |
+
|
389 |
+
from zenml.integrations.seldon.steps import seldon_custom_model_deployer_step
|
390 |
+
|
391 |
+
|
392 |
+
from zenml.integrations.seldon.services import SeldonDeploymentConfig
|
393 |
+
|
394 |
+
|
395 |
+
from zenml import pipeline
|
396 |
+
|
397 |
+
|
398 |
+
@pipeline
|
399 |
+
|
400 |
+
|
401 |
+
def seldon_deployment_pipeline():
|
402 |
+
|
403 |
+
|
404 |
+
model = ...
|
405 |
+
|
406 |
+
|
407 |
+
seldon_custom_model_deployer_step(
|
408 |
+
|
409 |
+
|
410 |
+
model=model,
|
411 |
+
|
412 |
+
|
413 |
+
predict_function="<PATH.TO.custom_predict>", # TODO: path to custom code
|
414 |
+
|
415 |
+
|
416 |
+
service_config=SeldonDeploymentConfig(
|
417 |
+
|
418 |
+
|
419 |
+
model_name="<MODEL_NAME>", # TODO: name of the deployed model
|
420 |
+
|
421 |
+
|
422 |
+
replicas=1,
|
423 |
+
|
424 |
+
|
425 |
+
implementation="custom",
|
426 |
+
|
427 |
+
|
428 |
+
resources=SeldonResourceRequirements(
|
429 |
+
|
430 |
+
|
431 |
+
limits={"cpu": "200m", "memory": "250Mi"}
|
432 |
+
|
433 |
+
|
434 |
+
),
|
435 |
+
|
436 |
+
|
437 |
+
serviceAccountName="kubernetes-service-account",
|
438 |
+
|
439 |
+
|
440 |
+
),
|
441 |
+
|
442 |
+
|
443 |
+
Advanced Custom Code Deployment with Seldon Core Integration
|
444 |
+
|
445 |
+
|
446 |
+
Before creating your custom model class, you should take a look at the custom
|
447 |
+
Python model section of the Seldon Core documentation.
|
448 |
+
|
449 |
+
|
450 |
+
The built-in Seldon Core custom deployment step is a good starting point for deploying
|
451 |
+
your custom models. However, if you want to deploy more than the trained model,
|
452 |
+
you can create your own custom class and a custom step to achieve this.
|
453 |
+
|
454 |
+
|
455 |
+
See the ZenML custom Seldon model class as a reference.
|
456 |
+
|
457 |
+
|
458 |
+
PreviousMLflow
|
459 |
+
|
460 |
+
|
461 |
+
NextBentoML
|
462 |
+
|
463 |
+
|
464 |
+
Last updated 15 days ago'
|
465 |
+
- 'Get arbitrary artifacts in a step
|
466 |
+
|
467 |
+
|
468 |
+
Not all artifacts need to come through the step interface from direct upstream
|
469 |
+
steps.
|
470 |
+
|
471 |
+
|
472 |
+
As described in the metadata guide, the metadata can be fetched with the client,
|
473 |
+
and this is how you would use it to fetch it within a step. This allows you to
|
474 |
+
fetch artifacts from other upstream steps or even completely different pipelines.
|
475 |
+
|
476 |
+
|
477 |
+
from zenml.client import Client
|
478 |
+
|
479 |
+
|
480 |
+
from zenml import step
|
481 |
+
|
482 |
+
|
483 |
+
@step
|
484 |
+
|
485 |
+
|
486 |
+
def my_step():
|
487 |
+
|
488 |
+
|
489 |
+
client = Client()
|
490 |
+
|
491 |
+
|
492 |
+
# Directly fetch an artifact
|
493 |
+
|
494 |
+
|
495 |
+
output = client.get_artifact_version("my_dataset", "my_version")
|
496 |
+
|
497 |
+
|
498 |
+
output.run_metadata["accuracy"].value
|
499 |
+
|
500 |
+
|
501 |
+
This is one of the ways you can access artifacts that have already been created
|
502 |
+
and stored in the artifact store. This can be useful when you want to use artifacts
|
503 |
+
from other pipelines or steps that are not directly upstream.
|
504 |
+
|
505 |
+
|
506 |
+
See Also
|
507 |
+
|
508 |
+
|
509 |
+
Managing artifacts - learn about the ExternalArtifact type and how to pass artifacts
|
510 |
+
between steps.
|
511 |
+
|
512 |
+
|
513 |
+
PreviousOrganize data with tags
|
514 |
+
|
515 |
+
|
516 |
+
NextHandle custom data types
|
517 |
+
|
518 |
+
|
519 |
+
Last updated 15 days ago'
|
520 |
+
- source_sentence: Where can I find more information about using Feast in ZenML?
|
521 |
+
sentences:
|
522 |
+
- 'hat''s described on the feast page: How to use it?.PreviousDevelop a Custom Model
|
523 |
+
Registry
|
524 |
+
|
525 |
+
|
526 |
+
NextFeast
|
527 |
+
|
528 |
+
|
529 |
+
Last updated 1 year ago'
|
530 |
+
- 'other remote stack components also running in AWS.This method uses the implicit
|
531 |
+
AWS authentication available in the environment where the ZenML code is running.
|
532 |
+
On your local machine, this is the quickest way to configure an S3 Artifact Store.
|
533 |
+
You don''t need to supply credentials explicitly when you register the S3 Artifact
|
534 |
+
Store, as it leverages the local credentials and configuration that the AWS CLI
|
535 |
+
stores on your local machine. However, you will need to install and set up the
|
536 |
+
AWS CLI on your machine as a prerequisite, as covered in the AWS CLI documentation,
|
537 |
+
before you register the S3 Artifact Store.
|
538 |
+
|
539 |
+
|
540 |
+
Certain dashboard functionality, such as visualizing or deleting artifacts, is
|
541 |
+
not available when using an implicitly authenticated artifact store together with
|
542 |
+
a deployed ZenML server because the ZenML server will not have permission to access
|
543 |
+
the filesystem.
|
544 |
+
|
545 |
+
|
546 |
+
The implicit authentication method also needs to be coordinated with other stack
|
547 |
+
components that are highly dependent on the Artifact Store and need to interact
|
548 |
+
with it directly to work. If these components are not running on your machine,
|
549 |
+
they do not have access to the local AWS CLI configuration and will encounter
|
550 |
+
authentication failures while trying to access the S3 Artifact Store:
|
551 |
+
|
552 |
+
|
553 |
+
Orchestrators need to access the Artifact Store to manage pipeline artifacts
|
554 |
+
|
555 |
+
|
556 |
+
Step Operators need to access the Artifact Store to manage step-level artifacts
|
557 |
+
|
558 |
+
|
559 |
+
Model Deployers need to access the Artifact Store to load served models
|
560 |
+
|
561 |
+
|
562 |
+
To enable these use-cases, it is recommended to use an AWS Service Connector to
|
563 |
+
link your S3 Artifact Store to the remote S3 bucket.
|
564 |
+
|
565 |
+
|
566 |
+
To set up the S3 Artifact Store to authenticate to AWS and access an S3 bucket,
|
567 |
+
it is recommended to leverage the many features provided by the AWS Service Connector
|
568 |
+
such as auto-configuration, best security practices regarding long-lived credentials
|
569 |
+
and fine-grained access control and reusing the same credentials across multiple
|
570 |
+
stack components.'
|
571 |
+
- ' us know!
|
572 |
+
|
573 |
+
|
574 |
+
Configuration at pipeline or step levelWhen running your ZenML pipeline with the
|
575 |
+
Sagemaker orchestrator, the configuration set when configuring the orchestrator
|
576 |
+
as a ZenML component will be used by default. However, it is possible to provide
|
577 |
+
additional configuration at the pipeline or step level. This allows you to run
|
578 |
+
whole pipelines or individual steps with alternative configurations. For example,
|
579 |
+
this allows you to run the training process with a heavier, GPU-enabled instance
|
580 |
+
type, while running other steps with lighter instances.
|
581 |
+
|
582 |
+
|
583 |
+
Additional configuration for the Sagemaker orchestrator can be passed via SagemakerOrchestratorSettings.
|
584 |
+
Here, it is possible to configure processor_args, which is a dictionary of arguments
|
585 |
+
for the Processor. For available arguments, see the Sagemaker documentation .
|
586 |
+
Currently, it is not possible to provide custom configuration for the following
|
587 |
+
attributes:
|
588 |
+
|
589 |
+
|
590 |
+
image_uri
|
591 |
+
|
592 |
+
|
593 |
+
instance_count
|
594 |
+
|
595 |
+
|
596 |
+
sagemaker_session
|
597 |
+
|
598 |
+
|
599 |
+
entrypoint
|
600 |
+
|
601 |
+
|
602 |
+
base_job_name
|
603 |
+
|
604 |
+
|
605 |
+
env
|
606 |
+
|
607 |
+
|
608 |
+
For example, settings can be provided in the following way:
|
609 |
+
|
610 |
+
|
611 |
+
sagemaker_orchestrator_settings = SagemakerOrchestratorSettings(
|
612 |
+
|
613 |
+
|
614 |
+
processor_args={
|
615 |
+
|
616 |
+
|
617 |
+
"instance_type": "ml.t3.medium",
|
618 |
+
|
619 |
+
|
620 |
+
"volume_size_in_gb": 30
|
621 |
+
|
622 |
+
|
623 |
+
They can then be applied to a step as follows:
|
624 |
+
|
625 |
+
|
626 |
+
@step(settings={"orchestrator.sagemaker": sagemaker_orchestrator_settings})
|
627 |
+
|
628 |
+
|
629 |
+
For example, if your ZenML component is configured to use ml.c5.xlarge with 400GB
|
630 |
+
additional storage by default, all steps will use it except for the step above,
|
631 |
+
which will use ml.t3.medium with 30GB additional storage.
|
632 |
+
|
633 |
+
|
634 |
+
Check out this docs page for more information on how to specify settings in general.
|
635 |
+
|
636 |
+
|
637 |
+
For more information and a full list of configurable attributes of the Sagemaker
|
638 |
+
orchestrator, check out the SDK Docs .
|
639 |
+
|
640 |
+
|
641 |
+
S3 data access in ZenML steps'
|
642 |
+
- source_sentence: How is the AWS region specified in the configuration for ZenML?
|
643 |
+
sentences:
|
644 |
+
- 'ge or if the ZenML version doesn''t change at all).a backup file or database
|
645 |
+
is created before every database migration attempt (i.e. during every Helm upgrade).
|
646 |
+
If a backup already exists (i.e. persisted in a persistent volume or backup database),
|
647 |
+
it is overwritten.
|
648 |
+
|
649 |
+
|
650 |
+
the persistent backup file or database is cleaned up after the migration is completed
|
651 |
+
successfully or if the database doesn''t need to undergo a migration. This includes
|
652 |
+
backups created by previous failed migration attempts.
|
653 |
+
|
654 |
+
|
655 |
+
the persistent backup file or database is NOT cleaned up after a failed migration.
|
656 |
+
This allows the user to manually inspect and/or apply the backup if the automatic
|
657 |
+
recovery fails.
|
658 |
+
|
659 |
+
|
660 |
+
The following example shows how to configure the ZenML server to use a persistent
|
661 |
+
volume to store the database dump file:
|
662 |
+
|
663 |
+
|
664 |
+
zenml:
|
665 |
+
|
666 |
+
|
667 |
+
# ...
|
668 |
+
|
669 |
+
|
670 |
+
database:
|
671 |
+
|
672 |
+
|
673 |
+
url: "mysql://admin:password@my.database.org:3306/zenml"
|
674 |
+
|
675 |
+
|
676 |
+
# Configure the database backup strategy
|
677 |
+
|
678 |
+
|
679 |
+
backupStrategy: dump-file
|
680 |
+
|
681 |
+
|
682 |
+
backupPVStorageSize: 1Gi
|
683 |
+
|
684 |
+
|
685 |
+
podSecurityContext:
|
686 |
+
|
687 |
+
|
688 |
+
fsGroup: 1000 # if you''re using a PVC for backup, this should necessarily be
|
689 |
+
set.
|
690 |
+
|
691 |
+
|
692 |
+
PreviousDeploy with Docker
|
693 |
+
|
694 |
+
|
695 |
+
NextDeploy using HuggingFace Spaces
|
696 |
+
|
697 |
+
|
698 |
+
Last updated 15 days ago'
|
699 |
+
- 'π²Control logging
|
700 |
+
|
701 |
+
|
702 |
+
Configuring ZenML''s default logging behavior
|
703 |
+
|
704 |
+
|
705 |
+
ZenML produces various kinds of logs:
|
706 |
+
|
707 |
+
|
708 |
+
The ZenML Server produces server logs (like any FastAPI server).
|
709 |
+
|
710 |
+
|
711 |
+
The Client or Runner environment produces logs, for example after running a pipeline.
|
712 |
+
These are steps that are typically before, after, and during the creation of a
|
713 |
+
pipeline run.
|
714 |
+
|
715 |
+
|
716 |
+
The Execution environment (on the orchestrator level) produces logs when it executes
|
717 |
+
each step of a pipeline. These are logs that are typically written in your steps
|
718 |
+
using the python logging module.
|
719 |
+
|
720 |
+
|
721 |
+
This section talks about how users can control logging behavior in these various
|
722 |
+
environments.
|
723 |
+
|
724 |
+
|
725 |
+
PreviousTrain with GPUs
|
726 |
+
|
727 |
+
|
728 |
+
NextView logs on the dashboard
|
729 |
+
|
730 |
+
|
731 |
+
Last updated 19 days ago'
|
732 |
+
- ' ββ βββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨
|
733 |
+
|
734 |
+
|
735 |
+
β SHARED β β β
|
736 |
+
|
737 |
+
|
738 |
+
β βββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨
|
739 |
+
|
740 |
+
|
741 |
+
β CREATED_AT β 2023-06-19 18:12:42.066053 β
|
742 |
+
|
743 |
+
|
744 |
+
β βββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨
|
745 |
+
|
746 |
+
|
747 |
+
β UPDATED_AT β 2023-06-19 18:12:42.066055 β
|
748 |
+
|
749 |
+
|
750 |
+
ββββββββββββββββββββ·ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
751 |
+
|
752 |
+
|
753 |
+
Configuration
|
754 |
+
|
755 |
+
|
756 |
+
βββββββββββββββββββββββββ―ββββββββββββ
|
757 |
+
|
758 |
+
|
759 |
+
β PROPERTY β VALUE β
|
760 |
+
|
761 |
+
|
762 |
+
β ββββββββββββββββββββββββΌββββββββββββ¨
|
763 |
+
|
764 |
+
|
765 |
+
β region β us-east-1 β
|
766 |
+
|
767 |
+
|
768 |
+
β ββββββββββββββββββββββββΌββββββββββββ¨
|
769 |
+
|
770 |
+
|
771 |
+
β aws_access_key_id β [HIDDEN] β
|
772 |
+
|
773 |
+
|
774 |
+
β ββββββββββββββββββββββββΌββββββββββββ¨
|
775 |
+
|
776 |
+
|
777 |
+
β aws_secret_access_key β [HIDDEN] β
|
778 |
+
|
779 |
+
|
780 |
+
βββββββββββββββββββββββββ·ββββββββββββ
|
781 |
+
|
782 |
+
|
783 |
+
AWS Secret Key
|
784 |
+
|
785 |
+
|
786 |
+
Long-lived AWS credentials consisting of an AWS access key ID and secret access
|
787 |
+
key associated with an AWS IAM user or AWS account root user (not recommended).
|
788 |
+
|
789 |
+
|
790 |
+
This method is preferred during development and testing due to its simplicity
|
791 |
+
and ease of use. It is not recommended as a direct authentication method for production
|
792 |
+
use cases because the clients have direct access to long-lived credentials and
|
793 |
+
are granted the full set of permissions of the IAM user or AWS account root user
|
794 |
+
associated with the credentials. For production, it is recommended to use the
|
795 |
+
AWS IAM Role, AWS Session Token, or AWS Federation Token authentication method
|
796 |
+
instead.
|
797 |
+
|
798 |
+
|
799 |
+
An AWS region is required and the connector may only be used to access AWS resources
|
800 |
+
in the specified region.
|
801 |
+
|
802 |
+
|
803 |
+
If you already have the local AWS CLI set up with these credentials, they will
|
804 |
+
be automatically picked up when auto-configuration is used (see the example below).'
|
805 |
+
- source_sentence: Can you explain how the `query_similar_docs` function handles document
|
806 |
+
reranking?
|
807 |
+
sentences:
|
808 |
+
- 'ry_similar_docs(
|
809 |
+
|
810 |
+
|
811 |
+
question: str,
|
812 |
+
|
813 |
+
|
814 |
+
url_ending: str,use_reranking: bool = False,
|
815 |
+
|
816 |
+
|
817 |
+
returned_sample_size: int = 5,
|
818 |
+
|
819 |
+
|
820 |
+
) -> Tuple[str, str, List[str]]:
|
821 |
+
|
822 |
+
|
823 |
+
"""Query similar documents for a given question and URL ending."""
|
824 |
+
|
825 |
+
|
826 |
+
embedded_question = get_embeddings(question)
|
827 |
+
|
828 |
+
|
829 |
+
db_conn = get_db_conn()
|
830 |
+
|
831 |
+
|
832 |
+
num_docs = 20 if use_reranking else returned_sample_size
|
833 |
+
|
834 |
+
|
835 |
+
# get (content, url) tuples for the top n similar documents
|
836 |
+
|
837 |
+
|
838 |
+
top_similar_docs = get_topn_similar_docs(
|
839 |
+
|
840 |
+
|
841 |
+
embedded_question, db_conn, n=num_docs, include_metadata=True
|
842 |
+
|
843 |
+
|
844 |
+
if use_reranking:
|
845 |
+
|
846 |
+
|
847 |
+
reranked_docs_and_urls = rerank_documents(question, top_similar_docs)[
|
848 |
+
|
849 |
+
|
850 |
+
:returned_sample_size
|
851 |
+
|
852 |
+
|
853 |
+
urls = [doc[1] for doc in reranked_docs_and_urls]
|
854 |
+
|
855 |
+
|
856 |
+
else:
|
857 |
+
|
858 |
+
|
859 |
+
urls = [doc[1] for doc in top_similar_docs] # Unpacking URLs
|
860 |
+
|
861 |
+
|
862 |
+
return (question, url_ending, urls)
|
863 |
+
|
864 |
+
|
865 |
+
We get the embeddings for the question being passed into the function and connect
|
866 |
+
to our PostgreSQL database. If we''re using reranking, we get the top 20 documents
|
867 |
+
similar to our query and rerank them using the rerank_documents helper function.
|
868 |
+
We then extract the URLs from the reranked documents and return them. Note that
|
869 |
+
we only return 5 URLs, but in the case of reranking we get a larger number of
|
870 |
+
documents and URLs back from the database to pass to our reranker, but in the
|
871 |
+
end we always choose the top five reranked documents to return.
|
872 |
+
|
873 |
+
|
874 |
+
Now that we''ve added reranking to our pipeline, we can evaluate the performance
|
875 |
+
of our reranker and see how it affects the quality of the retrieved documents.
|
876 |
+
|
877 |
+
|
878 |
+
Code Example
|
879 |
+
|
880 |
+
|
881 |
+
To explore the full code, visit the Complete Guide repository and for this section,
|
882 |
+
particularly the eval_retrieval.py file.
|
883 |
+
|
884 |
+
|
885 |
+
PreviousUnderstanding reranking
|
886 |
+
|
887 |
+
|
888 |
+
NextEvaluating reranking performance
|
889 |
+
|
890 |
+
|
891 |
+
Last updated 15 days ago'
|
892 |
+
- 'uter vision that expect a single dataset as input.model drift checks require
|
893 |
+
two datasets and a mandatory model as input. This list includes a subset of the
|
894 |
+
model evaluation checks provided by Deepchecks for tabular data and for computer
|
895 |
+
vision that expect two datasets as input: target and reference.
|
896 |
+
|
897 |
+
|
898 |
+
This structure is directly reflected in how Deepchecks can be used with ZenML:
|
899 |
+
there are four different Deepchecks standard steps and four different ZenML enums
|
900 |
+
for Deepchecks checks . The Deepchecks Data Validator API is also modeled to reflect
|
901 |
+
this same structure.
|
902 |
+
|
903 |
+
|
904 |
+
A notable characteristic of Deepchecks is that you don''t need to customize the
|
905 |
+
set of Deepchecks tests that are part of a test suite. Both ZenML and Deepchecks
|
906 |
+
provide sane defaults that will run all available Deepchecks tests in a given
|
907 |
+
category with their default conditions if a custom list of tests and conditions
|
908 |
+
are not provided.
|
909 |
+
|
910 |
+
|
911 |
+
There are three ways you can use Deepchecks in your ZenML pipelines that allow
|
912 |
+
different levels of flexibility:
|
913 |
+
|
914 |
+
|
915 |
+
instantiate, configure and insert one or more of the standard Deepchecks steps
|
916 |
+
shipped with ZenML into your pipelines. This is the easiest way and the recommended
|
917 |
+
approach, but can only be customized through the supported step configuration
|
918 |
+
parameters.
|
919 |
+
|
920 |
+
|
921 |
+
call the data validation methods provided by the Deepchecks Data Validator in
|
922 |
+
your custom step implementation. This method allows for more flexibility concerning
|
923 |
+
what can happen in the pipeline step, but you are still limited to the functionality
|
924 |
+
implemented in the Data Validator.
|
925 |
+
|
926 |
+
|
927 |
+
use the Deepchecks library directly in your custom step implementation. This gives
|
928 |
+
you complete freedom in how you are using Deepchecks'' features.
|
929 |
+
|
930 |
+
|
931 |
+
You can visualize Deepchecks results in Jupyter notebooks or view them directly
|
932 |
+
in the ZenML dashboard.
|
933 |
+
|
934 |
+
|
935 |
+
Warning! Usage in remote orchestrators'
|
936 |
+
- ' use for the database connection.
|
937 |
+
|
938 |
+
database_ssl_ca:# The path to the client SSL certificate to use for the database
|
939 |
+
connection.
|
940 |
+
|
941 |
+
database_ssl_cert:
|
942 |
+
|
943 |
+
|
944 |
+
# The path to the client SSL key to use for the database connection.
|
945 |
+
|
946 |
+
database_ssl_key:
|
947 |
+
|
948 |
+
|
949 |
+
# Whether to verify the database server SSL certificate.
|
950 |
+
|
951 |
+
database_ssl_verify_server_cert:
|
952 |
+
|
953 |
+
|
954 |
+
Run the deploy command and pass the config file above to it.Copyzenml deploy --config=/PATH/TO/FILENote
|
955 |
+
To be able to run the deploy command, you should have your cloud provider''s CLI
|
956 |
+
configured locally with permissions to create resources like MySQL databases and
|
957 |
+
networks.
|
958 |
+
|
959 |
+
|
960 |
+
Configuration file templates
|
961 |
+
|
962 |
+
|
963 |
+
Base configuration file
|
964 |
+
|
965 |
+
|
966 |
+
Below is the general structure of a config file. Use this as a base and then add
|
967 |
+
any cloud-specific parameters from the sections below.
|
968 |
+
|
969 |
+
|
970 |
+
# Name of the server deployment.
|
971 |
+
|
972 |
+
|
973 |
+
name:
|
974 |
+
|
975 |
+
|
976 |
+
# The server provider type, one of aws, gcp or azure.
|
977 |
+
|
978 |
+
|
979 |
+
provider:
|
980 |
+
|
981 |
+
|
982 |
+
# The path to the kubectl config file to use for deployment.
|
983 |
+
|
984 |
+
|
985 |
+
kubectl_config_path:
|
986 |
+
|
987 |
+
|
988 |
+
# The Kubernetes namespace to deploy the ZenML server to.
|
989 |
+
|
990 |
+
|
991 |
+
namespace: zenmlserver
|
992 |
+
|
993 |
+
|
994 |
+
# The path to the ZenML server helm chart to use for deployment.
|
995 |
+
|
996 |
+
|
997 |
+
helm_chart:
|
998 |
+
|
999 |
+
|
1000 |
+
# The repository and tag to use for the ZenML server Docker image.
|
1001 |
+
|
1002 |
+
|
1003 |
+
zenmlserver_image_repo: zenmldocker/zenml
|
1004 |
+
|
1005 |
+
|
1006 |
+
zenmlserver_image_tag: latest
|
1007 |
+
|
1008 |
+
|
1009 |
+
# Whether to deploy an nginx ingress controller as part of the deployment.
|
1010 |
+
|
1011 |
+
|
1012 |
+
create_ingress_controller: true
|
1013 |
+
|
1014 |
+
|
1015 |
+
# Whether to use TLS for the ingress.
|
1016 |
+
|
1017 |
+
|
1018 |
+
ingress_tls: true
|
1019 |
+
|
1020 |
+
|
1021 |
+
# Whether to generate self-signed TLS certificates for the ingress.
|
1022 |
+
|
1023 |
+
|
1024 |
+
ingress_tls_generate_certs: true
|
1025 |
+
|
1026 |
+
|
1027 |
+
# The name of the Kubernetes secret to use for the ingress.
|
1028 |
+
|
1029 |
+
|
1030 |
+
ingress_tls_secret_name: zenml-tls-certs
|
1031 |
+
|
1032 |
+
|
1033 |
+
# The ingress controller''s IP address. The ZenML server will be exposed on a
|
1034 |
+
subdomain of this IP. For AWS, if you have a hostname instead, use the following
|
1035 |
+
command to get the IP address: `dig +short <hostname>`.
|
1036 |
+
|
1037 |
+
|
1038 |
+
ingress_controller_ip:
|
1039 |
+
|
1040 |
+
|
1041 |
+
# Whether to create a SQL database service as part of the recipe.
|
1042 |
+
|
1043 |
+
|
1044 |
+
deploy_db: true
|
1045 |
+
|
1046 |
+
|
1047 |
+
# The username and password for the database.'
|
1048 |
+
model-index:
|
1049 |
+
- name: strickvl/finetuned-all-MiniLM-L6-v2
|
1050 |
+
results:
|
1051 |
+
- task:
|
1052 |
+
type: information-retrieval
|
1053 |
+
name: Information Retrieval
|
1054 |
+
dataset:
|
1055 |
+
name: dim 384
|
1056 |
+
type: dim_384
|
1057 |
+
metrics:
|
1058 |
+
- type: cosine_accuracy@1
|
1059 |
+
value: 0.30120481927710846
|
1060 |
+
name: Cosine Accuracy@1
|
1061 |
+
- type: cosine_accuracy@3
|
1062 |
+
value: 0.5421686746987951
|
1063 |
+
name: Cosine Accuracy@3
|
1064 |
+
- type: cosine_accuracy@5
|
1065 |
+
value: 0.6746987951807228
|
1066 |
+
name: Cosine Accuracy@5
|
1067 |
+
- type: cosine_accuracy@10
|
1068 |
+
value: 0.7409638554216867
|
1069 |
+
name: Cosine Accuracy@10
|
1070 |
+
- type: cosine_precision@1
|
1071 |
+
value: 0.30120481927710846
|
1072 |
+
name: Cosine Precision@1
|
1073 |
+
- type: cosine_precision@3
|
1074 |
+
value: 0.18072289156626503
|
1075 |
+
name: Cosine Precision@3
|
1076 |
+
- type: cosine_precision@5
|
1077 |
+
value: 0.13493975903614455
|
1078 |
+
name: Cosine Precision@5
|
1079 |
+
- type: cosine_precision@10
|
1080 |
+
value: 0.07409638554216866
|
1081 |
+
name: Cosine Precision@10
|
1082 |
+
- type: cosine_recall@1
|
1083 |
+
value: 0.30120481927710846
|
1084 |
+
name: Cosine Recall@1
|
1085 |
+
- type: cosine_recall@3
|
1086 |
+
value: 0.5421686746987951
|
1087 |
+
name: Cosine Recall@3
|
1088 |
+
- type: cosine_recall@5
|
1089 |
+
value: 0.6746987951807228
|
1090 |
+
name: Cosine Recall@5
|
1091 |
+
- type: cosine_recall@10
|
1092 |
+
value: 0.7409638554216867
|
1093 |
+
name: Cosine Recall@10
|
1094 |
+
- type: cosine_ndcg@10
|
1095 |
+
value: 0.5191955019858888
|
1096 |
+
name: Cosine Ndcg@10
|
1097 |
+
- type: cosine_mrr@10
|
1098 |
+
value: 0.44787244214955063
|
1099 |
+
name: Cosine Mrr@10
|
1100 |
+
- type: cosine_map@100
|
1101 |
+
value: 0.4579267717676669
|
1102 |
+
name: Cosine Map@100
|
1103 |
+
- task:
|
1104 |
+
type: information-retrieval
|
1105 |
+
name: Information Retrieval
|
1106 |
+
dataset:
|
1107 |
+
name: dim 256
|
1108 |
+
type: dim_256
|
1109 |
+
metrics:
|
1110 |
+
- type: cosine_accuracy@1
|
1111 |
+
value: 0.29518072289156627
|
1112 |
+
name: Cosine Accuracy@1
|
1113 |
+
- type: cosine_accuracy@3
|
1114 |
+
value: 0.5301204819277109
|
1115 |
+
name: Cosine Accuracy@3
|
1116 |
+
- type: cosine_accuracy@5
|
1117 |
+
value: 0.6325301204819277
|
1118 |
+
name: Cosine Accuracy@5
|
1119 |
+
- type: cosine_accuracy@10
|
1120 |
+
value: 0.7349397590361446
|
1121 |
+
name: Cosine Accuracy@10
|
1122 |
+
- type: cosine_precision@1
|
1123 |
+
value: 0.29518072289156627
|
1124 |
+
name: Cosine Precision@1
|
1125 |
+
- type: cosine_precision@3
|
1126 |
+
value: 0.17670682730923695
|
1127 |
+
name: Cosine Precision@3
|
1128 |
+
- type: cosine_precision@5
|
1129 |
+
value: 0.12650602409638553
|
1130 |
+
name: Cosine Precision@5
|
1131 |
+
- type: cosine_precision@10
|
1132 |
+
value: 0.07349397590361445
|
1133 |
+
name: Cosine Precision@10
|
1134 |
+
- type: cosine_recall@1
|
1135 |
+
value: 0.29518072289156627
|
1136 |
+
name: Cosine Recall@1
|
1137 |
+
- type: cosine_recall@3
|
1138 |
+
value: 0.5301204819277109
|
1139 |
+
name: Cosine Recall@3
|
1140 |
+
- type: cosine_recall@5
|
1141 |
+
value: 0.6325301204819277
|
1142 |
+
name: Cosine Recall@5
|
1143 |
+
- type: cosine_recall@10
|
1144 |
+
value: 0.7349397590361446
|
1145 |
+
name: Cosine Recall@10
|
1146 |
+
- type: cosine_ndcg@10
|
1147 |
+
value: 0.5118888198675068
|
1148 |
+
name: Cosine Ndcg@10
|
1149 |
+
- type: cosine_mrr@10
|
1150 |
+
value: 0.4409805890227577
|
1151 |
+
name: Cosine Mrr@10
|
1152 |
+
- type: cosine_map@100
|
1153 |
+
value: 0.45029464689656734
|
1154 |
+
name: Cosine Map@100
|
1155 |
+
- task:
|
1156 |
+
type: information-retrieval
|
1157 |
+
name: Information Retrieval
|
1158 |
+
dataset:
|
1159 |
+
name: dim 128
|
1160 |
+
type: dim_128
|
1161 |
+
metrics:
|
1162 |
+
- type: cosine_accuracy@1
|
1163 |
+
value: 0.2710843373493976
|
1164 |
+
name: Cosine Accuracy@1
|
1165 |
+
- type: cosine_accuracy@3
|
1166 |
+
value: 0.5120481927710844
|
1167 |
+
name: Cosine Accuracy@3
|
1168 |
+
- type: cosine_accuracy@5
|
1169 |
+
value: 0.6144578313253012
|
1170 |
+
name: Cosine Accuracy@5
|
1171 |
+
- type: cosine_accuracy@10
|
1172 |
+
value: 0.6987951807228916
|
1173 |
+
name: Cosine Accuracy@10
|
1174 |
+
- type: cosine_precision@1
|
1175 |
+
value: 0.2710843373493976
|
1176 |
+
name: Cosine Precision@1
|
1177 |
+
- type: cosine_precision@3
|
1178 |
+
value: 0.1706827309236948
|
1179 |
+
name: Cosine Precision@3
|
1180 |
+
- type: cosine_precision@5
|
1181 |
+
value: 0.12289156626506023
|
1182 |
+
name: Cosine Precision@5
|
1183 |
+
- type: cosine_precision@10
|
1184 |
+
value: 0.06987951807228915
|
1185 |
+
name: Cosine Precision@10
|
1186 |
+
- type: cosine_recall@1
|
1187 |
+
value: 0.2710843373493976
|
1188 |
+
name: Cosine Recall@1
|
1189 |
+
- type: cosine_recall@3
|
1190 |
+
value: 0.5120481927710844
|
1191 |
+
name: Cosine Recall@3
|
1192 |
+
- type: cosine_recall@5
|
1193 |
+
value: 0.6144578313253012
|
1194 |
+
name: Cosine Recall@5
|
1195 |
+
- type: cosine_recall@10
|
1196 |
+
value: 0.6987951807228916
|
1197 |
+
name: Cosine Recall@10
|
1198 |
+
- type: cosine_ndcg@10
|
1199 |
+
value: 0.4883715088201252
|
1200 |
+
name: Cosine Ndcg@10
|
1201 |
+
- type: cosine_mrr@10
|
1202 |
+
value: 0.4208237712755786
|
1203 |
+
name: Cosine Mrr@10
|
1204 |
+
- type: cosine_map@100
|
1205 |
+
value: 0.4307910346351659
|
1206 |
+
name: Cosine Map@100
|
1207 |
+
- task:
|
1208 |
+
type: information-retrieval
|
1209 |
+
name: Information Retrieval
|
1210 |
+
dataset:
|
1211 |
+
name: dim 64
|
1212 |
+
type: dim_64
|
1213 |
+
metrics:
|
1214 |
+
- type: cosine_accuracy@1
|
1215 |
+
value: 0.25301204819277107
|
1216 |
+
name: Cosine Accuracy@1
|
1217 |
+
- type: cosine_accuracy@3
|
1218 |
+
value: 0.4578313253012048
|
1219 |
+
name: Cosine Accuracy@3
|
1220 |
+
- type: cosine_accuracy@5
|
1221 |
+
value: 0.5542168674698795
|
1222 |
+
name: Cosine Accuracy@5
|
1223 |
+
- type: cosine_accuracy@10
|
1224 |
+
value: 0.6566265060240963
|
1225 |
+
name: Cosine Accuracy@10
|
1226 |
+
- type: cosine_precision@1
|
1227 |
+
value: 0.25301204819277107
|
1228 |
+
name: Cosine Precision@1
|
1229 |
+
- type: cosine_precision@3
|
1230 |
+
value: 0.15261044176706828
|
1231 |
+
name: Cosine Precision@3
|
1232 |
+
- type: cosine_precision@5
|
1233 |
+
value: 0.1108433734939759
|
1234 |
+
name: Cosine Precision@5
|
1235 |
+
- type: cosine_precision@10
|
1236 |
+
value: 0.06566265060240963
|
1237 |
+
name: Cosine Precision@10
|
1238 |
+
- type: cosine_recall@1
|
1239 |
+
value: 0.25301204819277107
|
1240 |
+
name: Cosine Recall@1
|
1241 |
+
- type: cosine_recall@3
|
1242 |
+
value: 0.4578313253012048
|
1243 |
+
name: Cosine Recall@3
|
1244 |
+
- type: cosine_recall@5
|
1245 |
+
value: 0.5542168674698795
|
1246 |
+
name: Cosine Recall@5
|
1247 |
+
- type: cosine_recall@10
|
1248 |
+
value: 0.6566265060240963
|
1249 |
+
name: Cosine Recall@10
|
1250 |
+
- type: cosine_ndcg@10
|
1251 |
+
value: 0.4465853836525359
|
1252 |
+
name: Cosine Ndcg@10
|
1253 |
+
- type: cosine_mrr@10
|
1254 |
+
value: 0.380495792694588
|
1255 |
+
name: Cosine Mrr@10
|
1256 |
+
- type: cosine_map@100
|
1257 |
+
value: 0.39060460620612997
|
1258 |
+
name: Cosine Map@100
|
1259 |
+
---
|
1260 |
+
|
1261 |
+
# strickvl/finetuned-all-MiniLM-L6-v2
|
1262 |
+
|
1263 |
+
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.
|
1264 |
+
|
1265 |
+
## Model Details
|
1266 |
+
|
1267 |
+
### Model Description
|
1268 |
+
- **Model Type:** Sentence Transformer
|
1269 |
+
- **Base model:** [sentence-transformers/all-MiniLM-L6-v2](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2) <!-- at revision 8b3219a92973c328a8e22fadcfa821b5dc75636a -->
|
1270 |
+
- **Maximum Sequence Length:** 256 tokens
|
1271 |
+
- **Output Dimensionality:** 384 tokens
|
1272 |
+
- **Similarity Function:** Cosine Similarity
|
1273 |
+
<!-- - **Training Dataset:** Unknown -->
|
1274 |
+
- **Language:** en
|
1275 |
+
- **License:** apache-2.0
|
1276 |
+
|
1277 |
+
### Model Sources
|
1278 |
+
|
1279 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
1280 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
1281 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
1282 |
+
|
1283 |
+
### Full Model Architecture
|
1284 |
+
|
1285 |
+
```
|
1286 |
+
SentenceTransformer(
|
1287 |
+
(0): Transformer({'max_seq_length': 256, 'do_lower_case': False}) with Transformer model: BertModel
|
1288 |
+
(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})
|
1289 |
+
(2): Normalize()
|
1290 |
+
)
|
1291 |
+
```
|
1292 |
+
|
1293 |
+
## Usage
|
1294 |
+
|
1295 |
+
### Direct Usage (Sentence Transformers)
|
1296 |
+
|
1297 |
+
First install the Sentence Transformers library:
|
1298 |
+
|
1299 |
+
```bash
|
1300 |
+
pip install -U sentence-transformers
|
1301 |
+
```
|
1302 |
+
|
1303 |
+
Then you can load this model and run inference.
|
1304 |
+
```python
|
1305 |
+
from sentence_transformers import SentenceTransformer
|
1306 |
+
|
1307 |
+
# Download from the π€ Hub
|
1308 |
+
model = SentenceTransformer("strickvl/finetuned-all-MiniLM-L6-v2")
|
1309 |
+
# Run inference
|
1310 |
+
sentences = [
|
1311 |
+
'Can you explain how the `query_similar_docs` function handles document reranking?',
|
1312 |
+
'ry_similar_docs(\n\nquestion: str,\n\nurl_ending: str,use_reranking: bool = False,\n\nreturned_sample_size: int = 5,\n\n) -> Tuple[str, str, List[str]]:\n\n"""Query similar documents for a given question and URL ending."""\n\nembedded_question = get_embeddings(question)\n\ndb_conn = get_db_conn()\n\nnum_docs = 20 if use_reranking else returned_sample_size\n\n# get (content, url) tuples for the top n similar documents\n\ntop_similar_docs = get_topn_similar_docs(\n\nembedded_question, db_conn, n=num_docs, include_metadata=True\n\nif use_reranking:\n\nreranked_docs_and_urls = rerank_documents(question, top_similar_docs)[\n\n:returned_sample_size\n\nurls = [doc[1] for doc in reranked_docs_and_urls]\n\nelse:\n\nurls = [doc[1] for doc in top_similar_docs] # Unpacking URLs\n\nreturn (question, url_ending, urls)\n\nWe get the embeddings for the question being passed into the function and connect to our PostgreSQL database. If we\'re using reranking, we get the top 20 documents similar to our query and rerank them using the rerank_documents helper function. We then extract the URLs from the reranked documents and return them. Note that we only return 5 URLs, but in the case of reranking we get a larger number of documents and URLs back from the database to pass to our reranker, but in the end we always choose the top five reranked documents to return.\n\nNow that we\'ve added reranking to our pipeline, we can evaluate the performance of our reranker and see how it affects the quality of the retrieved documents.\n\nCode Example\n\nTo explore the full code, visit the Complete Guide repository and for this section, particularly the eval_retrieval.py file.\n\nPreviousUnderstanding reranking\n\nNextEvaluating reranking performance\n\nLast updated 15 days ago',
|
1313 |
+
" use for the database connection.\ndatabase_ssl_ca:# The path to the client SSL certificate to use for the database connection.\ndatabase_ssl_cert:\n\n# The path to the client SSL key to use for the database connection.\ndatabase_ssl_key:\n\n# Whether to verify the database server SSL certificate.\ndatabase_ssl_verify_server_cert:\n\nRun the deploy command and pass the config file above to it.Copyzenml deploy --config=/PATH/TO/FILENote To be able to run the deploy command, you should have your cloud provider's CLI configured locally with permissions to create resources like MySQL databases and networks.\n\nConfiguration file templates\n\nBase configuration file\n\nBelow is the general structure of a config file. Use this as a base and then add any cloud-specific parameters from the sections below.\n\n# Name of the server deployment.\n\nname:\n\n# The server provider type, one of aws, gcp or azure.\n\nprovider:\n\n# The path to the kubectl config file to use for deployment.\n\nkubectl_config_path:\n\n# The Kubernetes namespace to deploy the ZenML server to.\n\nnamespace: zenmlserver\n\n# The path to the ZenML server helm chart to use for deployment.\n\nhelm_chart:\n\n# The repository and tag to use for the ZenML server Docker image.\n\nzenmlserver_image_repo: zenmldocker/zenml\n\nzenmlserver_image_tag: latest\n\n# Whether to deploy an nginx ingress controller as part of the deployment.\n\ncreate_ingress_controller: true\n\n# Whether to use TLS for the ingress.\n\ningress_tls: true\n\n# Whether to generate self-signed TLS certificates for the ingress.\n\ningress_tls_generate_certs: true\n\n# The name of the Kubernetes secret to use for the ingress.\n\ningress_tls_secret_name: zenml-tls-certs\n\n# The ingress controller's IP address. The ZenML server will be exposed on a subdomain of this IP. For AWS, if you have a hostname instead, use the following command to get the IP address: `dig +short <hostname>`.\n\ningress_controller_ip:\n\n# Whether to create a SQL database service as part of the recipe.\n\ndeploy_db: true\n\n# The username and password for the database.",
|
1314 |
+
]
|
1315 |
+
embeddings = model.encode(sentences)
|
1316 |
+
print(embeddings.shape)
|
1317 |
+
# [3, 384]
|
1318 |
+
|
1319 |
+
# Get the similarity scores for the embeddings
|
1320 |
+
similarities = model.similarity(embeddings, embeddings)
|
1321 |
+
print(similarities.shape)
|
1322 |
+
# [3, 3]
|
1323 |
+
```
|
1324 |
+
|
1325 |
+
<!--
|
1326 |
+
### Direct Usage (Transformers)
|
1327 |
+
|
1328 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
1329 |
+
|
1330 |
+
</details>
|
1331 |
+
-->
|
1332 |
+
|
1333 |
+
<!--
|
1334 |
+
### Downstream Usage (Sentence Transformers)
|
1335 |
+
|
1336 |
+
You can finetune this model on your own dataset.
|
1337 |
+
|
1338 |
+
<details><summary>Click to expand</summary>
|
1339 |
+
|
1340 |
+
</details>
|
1341 |
+
-->
|
1342 |
+
|
1343 |
+
<!--
|
1344 |
+
### Out-of-Scope Use
|
1345 |
+
|
1346 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
1347 |
+
-->
|
1348 |
+
|
1349 |
+
## Evaluation
|
1350 |
+
|
1351 |
+
### Metrics
|
1352 |
+
|
1353 |
+
#### Information Retrieval
|
1354 |
+
* Dataset: `dim_384`
|
1355 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
|
1356 |
+
|
1357 |
+
| Metric | Value |
|
1358 |
+
|:--------------------|:-----------|
|
1359 |
+
| cosine_accuracy@1 | 0.3012 |
|
1360 |
+
| cosine_accuracy@3 | 0.5422 |
|
1361 |
+
| cosine_accuracy@5 | 0.6747 |
|
1362 |
+
| cosine_accuracy@10 | 0.741 |
|
1363 |
+
| cosine_precision@1 | 0.3012 |
|
1364 |
+
| cosine_precision@3 | 0.1807 |
|
1365 |
+
| cosine_precision@5 | 0.1349 |
|
1366 |
+
| cosine_precision@10 | 0.0741 |
|
1367 |
+
| cosine_recall@1 | 0.3012 |
|
1368 |
+
| cosine_recall@3 | 0.5422 |
|
1369 |
+
| cosine_recall@5 | 0.6747 |
|
1370 |
+
| cosine_recall@10 | 0.741 |
|
1371 |
+
| cosine_ndcg@10 | 0.5192 |
|
1372 |
+
| cosine_mrr@10 | 0.4479 |
|
1373 |
+
| **cosine_map@100** | **0.4579** |
|
1374 |
+
|
1375 |
+
#### Information Retrieval
|
1376 |
+
* Dataset: `dim_256`
|
1377 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
|
1378 |
+
|
1379 |
+
| Metric | Value |
|
1380 |
+
|:--------------------|:-----------|
|
1381 |
+
| cosine_accuracy@1 | 0.2952 |
|
1382 |
+
| cosine_accuracy@3 | 0.5301 |
|
1383 |
+
| cosine_accuracy@5 | 0.6325 |
|
1384 |
+
| cosine_accuracy@10 | 0.7349 |
|
1385 |
+
| cosine_precision@1 | 0.2952 |
|
1386 |
+
| cosine_precision@3 | 0.1767 |
|
1387 |
+
| cosine_precision@5 | 0.1265 |
|
1388 |
+
| cosine_precision@10 | 0.0735 |
|
1389 |
+
| cosine_recall@1 | 0.2952 |
|
1390 |
+
| cosine_recall@3 | 0.5301 |
|
1391 |
+
| cosine_recall@5 | 0.6325 |
|
1392 |
+
| cosine_recall@10 | 0.7349 |
|
1393 |
+
| cosine_ndcg@10 | 0.5119 |
|
1394 |
+
| cosine_mrr@10 | 0.441 |
|
1395 |
+
| **cosine_map@100** | **0.4503** |
|
1396 |
+
|
1397 |
+
#### Information Retrieval
|
1398 |
+
* Dataset: `dim_128`
|
1399 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
|
1400 |
+
|
1401 |
+
| Metric | Value |
|
1402 |
+
|:--------------------|:-----------|
|
1403 |
+
| cosine_accuracy@1 | 0.2711 |
|
1404 |
+
| cosine_accuracy@3 | 0.512 |
|
1405 |
+
| cosine_accuracy@5 | 0.6145 |
|
1406 |
+
| cosine_accuracy@10 | 0.6988 |
|
1407 |
+
| cosine_precision@1 | 0.2711 |
|
1408 |
+
| cosine_precision@3 | 0.1707 |
|
1409 |
+
| cosine_precision@5 | 0.1229 |
|
1410 |
+
| cosine_precision@10 | 0.0699 |
|
1411 |
+
| cosine_recall@1 | 0.2711 |
|
1412 |
+
| cosine_recall@3 | 0.512 |
|
1413 |
+
| cosine_recall@5 | 0.6145 |
|
1414 |
+
| cosine_recall@10 | 0.6988 |
|
1415 |
+
| cosine_ndcg@10 | 0.4884 |
|
1416 |
+
| cosine_mrr@10 | 0.4208 |
|
1417 |
+
| **cosine_map@100** | **0.4308** |
|
1418 |
+
|
1419 |
+
#### Information Retrieval
|
1420 |
+
* Dataset: `dim_64`
|
1421 |
+
* Evaluated with [<code>InformationRetrievalEvaluator</code>](https://sbert.net/docs/package_reference/sentence_transformer/evaluation.html#sentence_transformers.evaluation.InformationRetrievalEvaluator)
|
1422 |
+
|
1423 |
+
| Metric | Value |
|
1424 |
+
|:--------------------|:-----------|
|
1425 |
+
| cosine_accuracy@1 | 0.253 |
|
1426 |
+
| cosine_accuracy@3 | 0.4578 |
|
1427 |
+
| cosine_accuracy@5 | 0.5542 |
|
1428 |
+
| cosine_accuracy@10 | 0.6566 |
|
1429 |
+
| cosine_precision@1 | 0.253 |
|
1430 |
+
| cosine_precision@3 | 0.1526 |
|
1431 |
+
| cosine_precision@5 | 0.1108 |
|
1432 |
+
| cosine_precision@10 | 0.0657 |
|
1433 |
+
| cosine_recall@1 | 0.253 |
|
1434 |
+
| cosine_recall@3 | 0.4578 |
|
1435 |
+
| cosine_recall@5 | 0.5542 |
|
1436 |
+
| cosine_recall@10 | 0.6566 |
|
1437 |
+
| cosine_ndcg@10 | 0.4466 |
|
1438 |
+
| cosine_mrr@10 | 0.3805 |
|
1439 |
+
| **cosine_map@100** | **0.3906** |
|
1440 |
+
|
1441 |
+
<!--
|
1442 |
+
## Bias, Risks and Limitations
|
1443 |
+
|
1444 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
1445 |
+
-->
|
1446 |
+
|
1447 |
+
<!--
|
1448 |
+
### Recommendations
|
1449 |
+
|
1450 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
1451 |
+
-->
|
1452 |
+
|
1453 |
+
## Training Details
|
1454 |
+
|
1455 |
+
### Training Dataset
|
1456 |
+
|
1457 |
+
#### Unnamed Dataset
|
1458 |
+
|
1459 |
+
|
1460 |
+
* Size: 1,490 training samples
|
1461 |
+
* Columns: <code>positive</code> and <code>anchor</code>
|
1462 |
+
* Approximate statistics based on the first 1000 samples:
|
1463 |
+
| | positive | anchor |
|
1464 |
+
|:--------|:----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|
|
1465 |
+
| type | string | string |
|
1466 |
+
| details | <ul><li>min: 9 tokens</li><li>mean: 21.12 tokens</li><li>max: 49 tokens</li></ul> | <ul><li>min: 21 tokens</li><li>mean: 240.72 tokens</li><li>max: 256 tokens</li></ul> |
|
1467 |
+
* Samples:
|
1468 |
+
| positive | anchor |
|
1469 |
+
|:---------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
1470 |
+
| <code>Can you provide the details for the Azure service principal with the ID 273d2812-2643-4446-82e6-6098b8ccdaa4?</code> | <code> ββ βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨<br><br>β ID β 273d2812-2643-4446-82e6-6098b8ccdaa4 β<br><br>β βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨<br><br>β NAME β azure-service-principal β<br><br>β βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨<br><br>β TYPE β π¦ azure β<br><br>β βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨<br><br>β AUTH METHOD β service-principal β<br><br>β βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨<br><br>β RESOURCE TYPES β π¦ azure-generic, π¦ blob-container, π kubernetes-cluster, π³ docker-registry β<br><br>β βββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββοΏ½οΏ½ββββββββββββββββββββββββββββββ¨<br><br>β RESOURCE NAME β <multiple> β<br><br>β βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨<br><br>β SECRET ID β 50d9f230-c4ea-400e-b2d7-6b52ba2a6f90 β<br><br>β βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨<br><br>β SESSION DURATION β N/A β<br><br>β βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨<br><br>β EXPIRES IN β N/A β<br><br>β βββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ¨</code> |
|
1471 |
+
| <code>What are the new features introduced in ZenML 0.20.0 regarding the Metadata Store?</code> | <code>ed to update the way they are registered in ZenML.the updated ZenML server provides a new and improved collaborative experience. When connected to a ZenML server, you can now share your ZenML Stacks and Stack Components with other users. If you were previously using the ZenML Profiles or the ZenML server to share your ZenML Stacks, you should switch to the new ZenML server and Dashboard and update your existing workflows to reflect the new features.<br><br>ZenML takes over the Metadata Store role<br><br>ZenML can now run as a server that can be accessed via a REST API and also comes with a visual user interface (called the ZenML Dashboard). This server can be deployed in arbitrary environments (local, on-prem, via Docker, on AWS, GCP, Azure etc.) and supports user management, workspace scoping, and more.<br><br>The release introduces a series of commands to facilitate managing the lifecycle of the ZenML server and to access the pipeline and pipeline run information:<br><br>zenml connect / disconnect / down / up / logs / status can be used to configure your client to connect to a ZenML server, to start a local ZenML Dashboard or to deploy a ZenML server to a cloud environment. For more information on how to use these commands, see the ZenML deployment documentation.<br><br>zenml pipeline list / runs / delete can be used to display information and about and manage your pipelines and pipeline runs.<br><br>In ZenML 0.13.2 and earlier versions, information about pipelines and pipeline runs used to be stored in a separate stack component called the Metadata Store. Starting with 0.20.0, the role of the Metadata Store is now taken over by ZenML itself. This means that the Metadata Store is no longer a separate component in the ZenML architecture, but rather a part of the ZenML core, located wherever ZenML is deployed: locally on your machine or running remotely as a server.</code> |
|
1472 |
+
| <code>Which environment variables should I set to use the Azure Service Connector authentication method in 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> |
|
1473 |
+
* Loss: [<code>MatryoshkaLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#matryoshkaloss) with these parameters:
|
1474 |
+
```json
|
1475 |
+
{
|
1476 |
+
"loss": "MultipleNegativesRankingLoss",
|
1477 |
+
"matryoshka_dims": [
|
1478 |
+
384,
|
1479 |
+
256,
|
1480 |
+
128,
|
1481 |
+
64
|
1482 |
+
],
|
1483 |
+
"matryoshka_weights": [
|
1484 |
+
1,
|
1485 |
+
1,
|
1486 |
+
1,
|
1487 |
+
1
|
1488 |
+
],
|
1489 |
+
"n_dims_per_step": -1
|
1490 |
+
}
|
1491 |
+
```
|
1492 |
+
|
1493 |
+
### Training Hyperparameters
|
1494 |
+
#### Non-Default Hyperparameters
|
1495 |
+
|
1496 |
+
- `eval_strategy`: epoch
|
1497 |
+
- `per_device_train_batch_size`: 32
|
1498 |
+
- `per_device_eval_batch_size`: 16
|
1499 |
+
- `gradient_accumulation_steps`: 16
|
1500 |
+
- `learning_rate`: 2e-05
|
1501 |
+
- `num_train_epochs`: 4
|
1502 |
+
- `lr_scheduler_type`: cosine
|
1503 |
+
- `warmup_ratio`: 0.1
|
1504 |
+
- `bf16`: True
|
1505 |
+
- `tf32`: True
|
1506 |
+
- `load_best_model_at_end`: True
|
1507 |
+
- `optim`: adamw_torch_fused
|
1508 |
+
- `batch_sampler`: no_duplicates
|
1509 |
+
|
1510 |
+
#### All Hyperparameters
|
1511 |
+
<details><summary>Click to expand</summary>
|
1512 |
+
|
1513 |
+
- `overwrite_output_dir`: False
|
1514 |
+
- `do_predict`: False
|
1515 |
+
- `eval_strategy`: epoch
|
1516 |
+
- `prediction_loss_only`: True
|
1517 |
+
- `per_device_train_batch_size`: 32
|
1518 |
+
- `per_device_eval_batch_size`: 16
|
1519 |
+
- `per_gpu_train_batch_size`: None
|
1520 |
+
- `per_gpu_eval_batch_size`: None
|
1521 |
+
- `gradient_accumulation_steps`: 16
|
1522 |
+
- `eval_accumulation_steps`: None
|
1523 |
+
- `learning_rate`: 2e-05
|
1524 |
+
- `weight_decay`: 0.0
|
1525 |
+
- `adam_beta1`: 0.9
|
1526 |
+
- `adam_beta2`: 0.999
|
1527 |
+
- `adam_epsilon`: 1e-08
|
1528 |
+
- `max_grad_norm`: 1.0
|
1529 |
+
- `num_train_epochs`: 4
|
1530 |
+
- `max_steps`: -1
|
1531 |
+
- `lr_scheduler_type`: cosine
|
1532 |
+
- `lr_scheduler_kwargs`: {}
|
1533 |
+
- `warmup_ratio`: 0.1
|
1534 |
+
- `warmup_steps`: 0
|
1535 |
+
- `log_level`: passive
|
1536 |
+
- `log_level_replica`: warning
|
1537 |
+
- `log_on_each_node`: True
|
1538 |
+
- `logging_nan_inf_filter`: True
|
1539 |
+
- `save_safetensors`: True
|
1540 |
+
- `save_on_each_node`: False
|
1541 |
+
- `save_only_model`: False
|
1542 |
+
- `restore_callback_states_from_checkpoint`: False
|
1543 |
+
- `no_cuda`: False
|
1544 |
+
- `use_cpu`: False
|
1545 |
+
- `use_mps_device`: False
|
1546 |
+
- `seed`: 42
|
1547 |
+
- `data_seed`: None
|
1548 |
+
- `jit_mode_eval`: False
|
1549 |
+
- `use_ipex`: False
|
1550 |
+
- `bf16`: True
|
1551 |
+
- `fp16`: False
|
1552 |
+
- `fp16_opt_level`: O1
|
1553 |
+
- `half_precision_backend`: auto
|
1554 |
+
- `bf16_full_eval`: False
|
1555 |
+
- `fp16_full_eval`: False
|
1556 |
+
- `tf32`: True
|
1557 |
+
- `local_rank`: 0
|
1558 |
+
- `ddp_backend`: None
|
1559 |
+
- `tpu_num_cores`: None
|
1560 |
+
- `tpu_metrics_debug`: False
|
1561 |
+
- `debug`: []
|
1562 |
+
- `dataloader_drop_last`: False
|
1563 |
+
- `dataloader_num_workers`: 0
|
1564 |
+
- `dataloader_prefetch_factor`: None
|
1565 |
+
- `past_index`: -1
|
1566 |
+
- `disable_tqdm`: True
|
1567 |
+
- `remove_unused_columns`: True
|
1568 |
+
- `label_names`: None
|
1569 |
+
- `load_best_model_at_end`: True
|
1570 |
+
- `ignore_data_skip`: False
|
1571 |
+
- `fsdp`: []
|
1572 |
+
- `fsdp_min_num_params`: 0
|
1573 |
+
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
1574 |
+
- `fsdp_transformer_layer_cls_to_wrap`: None
|
1575 |
+
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
1576 |
+
- `deepspeed`: None
|
1577 |
+
- `label_smoothing_factor`: 0.0
|
1578 |
+
- `optim`: adamw_torch_fused
|
1579 |
+
- `optim_args`: None
|
1580 |
+
- `adafactor`: False
|
1581 |
+
- `group_by_length`: False
|
1582 |
+
- `length_column_name`: length
|
1583 |
+
- `ddp_find_unused_parameters`: None
|
1584 |
+
- `ddp_bucket_cap_mb`: None
|
1585 |
+
- `ddp_broadcast_buffers`: False
|
1586 |
+
- `dataloader_pin_memory`: True
|
1587 |
+
- `dataloader_persistent_workers`: False
|
1588 |
+
- `skip_memory_metrics`: True
|
1589 |
+
- `use_legacy_prediction_loop`: False
|
1590 |
+
- `push_to_hub`: False
|
1591 |
+
- `resume_from_checkpoint`: None
|
1592 |
+
- `hub_model_id`: None
|
1593 |
+
- `hub_strategy`: every_save
|
1594 |
+
- `hub_private_repo`: False
|
1595 |
+
- `hub_always_push`: False
|
1596 |
+
- `gradient_checkpointing`: False
|
1597 |
+
- `gradient_checkpointing_kwargs`: None
|
1598 |
+
- `include_inputs_for_metrics`: False
|
1599 |
+
- `eval_do_concat_batches`: True
|
1600 |
+
- `fp16_backend`: auto
|
1601 |
+
- `push_to_hub_model_id`: None
|
1602 |
+
- `push_to_hub_organization`: None
|
1603 |
+
- `mp_parameters`:
|
1604 |
+
- `auto_find_batch_size`: False
|
1605 |
+
- `full_determinism`: False
|
1606 |
+
- `torchdynamo`: None
|
1607 |
+
- `ray_scope`: last
|
1608 |
+
- `ddp_timeout`: 1800
|
1609 |
+
- `torch_compile`: False
|
1610 |
+
- `torch_compile_backend`: None
|
1611 |
+
- `torch_compile_mode`: None
|
1612 |
+
- `dispatch_batches`: None
|
1613 |
+
- `split_batches`: None
|
1614 |
+
- `include_tokens_per_second`: False
|
1615 |
+
- `include_num_input_tokens_seen`: False
|
1616 |
+
- `neftune_noise_alpha`: None
|
1617 |
+
- `optim_target_modules`: None
|
1618 |
+
- `batch_eval_metrics`: False
|
1619 |
+
- `batch_sampler`: no_duplicates
|
1620 |
+
- `multi_dataset_batch_sampler`: proportional
|
1621 |
+
|
1622 |
+
</details>
|
1623 |
+
|
1624 |
+
### Training Logs
|
1625 |
+
| Epoch | Step | dim_128_cosine_map@100 | dim_256_cosine_map@100 | dim_384_cosine_map@100 | dim_64_cosine_map@100 |
|
1626 |
+
|:----------:|:-----:|:----------------------:|:----------------------:|:----------------------:|:---------------------:|
|
1627 |
+
| 0.6667 | 1 | 0.3800 | 0.3986 | 0.4149 | 0.3471 |
|
1628 |
+
| 2.0 | 3 | 0.4194 | 0.4473 | 0.4557 | 0.3762 |
|
1629 |
+
| **2.6667** | **4** | **0.4308** | **0.4503** | **0.4579** | **0.3906** |
|
1630 |
+
|
1631 |
+
* The bold row denotes the saved checkpoint.
|
1632 |
+
|
1633 |
+
### Framework Versions
|
1634 |
+
- Python: 3.10.14
|
1635 |
+
- Sentence Transformers: 3.0.1
|
1636 |
+
- Transformers: 4.41.2
|
1637 |
+
- PyTorch: 2.3.1+cu121
|
1638 |
+
- Accelerate: 0.31.0
|
1639 |
+
- Datasets: 2.19.1
|
1640 |
+
- Tokenizers: 0.19.1
|
1641 |
+
|
1642 |
+
## Citation
|
1643 |
+
|
1644 |
+
### BibTeX
|
1645 |
+
|
1646 |
+
#### Sentence Transformers
|
1647 |
+
```bibtex
|
1648 |
+
@inproceedings{reimers-2019-sentence-bert,
|
1649 |
+
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
|
1650 |
+
author = "Reimers, Nils and Gurevych, Iryna",
|
1651 |
+
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
|
1652 |
+
month = "11",
|
1653 |
+
year = "2019",
|
1654 |
+
publisher = "Association for Computational Linguistics",
|
1655 |
+
url = "https://arxiv.org/abs/1908.10084",
|
1656 |
+
}
|
1657 |
+
```
|
1658 |
+
|
1659 |
+
#### MatryoshkaLoss
|
1660 |
+
```bibtex
|
1661 |
+
@misc{kusupati2024matryoshka,
|
1662 |
+
title={Matryoshka Representation Learning},
|
1663 |
+
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},
|
1664 |
+
year={2024},
|
1665 |
+
eprint={2205.13147},
|
1666 |
+
archivePrefix={arXiv},
|
1667 |
+
primaryClass={cs.LG}
|
1668 |
+
}
|
1669 |
+
```
|
1670 |
+
|
1671 |
+
#### MultipleNegativesRankingLoss
|
1672 |
+
```bibtex
|
1673 |
+
@misc{henderson2017efficient,
|
1674 |
+
title={Efficient Natural Language Response Suggestion for Smart Reply},
|
1675 |
+
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},
|
1676 |
+
year={2017},
|
1677 |
+
eprint={1705.00652},
|
1678 |
+
archivePrefix={arXiv},
|
1679 |
+
primaryClass={cs.CL}
|
1680 |
+
}
|
1681 |
+
```
|
1682 |
+
|
1683 |
+
<!--
|
1684 |
+
## Glossary
|
1685 |
+
|
1686 |
+
*Clearly define terms in order to be accessible across audiences.*
|
1687 |
+
-->
|
1688 |
+
|
1689 |
+
<!--
|
1690 |
+
## Model Card Authors
|
1691 |
+
|
1692 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
1693 |
+
-->
|
1694 |
+
|
1695 |
+
<!--
|
1696 |
+
## Model Card Contact
|
1697 |
+
|
1698 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
1699 |
+
-->
|
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:2b69360420ddd14d5b25012577ac8378d38c238784d20d6fda18cf2d1756bb3d
|
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
|
|