You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Refactor documentation for clarity
- Removed unnecessary line breaks in the PyTorch integration documentation, enhancing readability and ensuring a smoother flow of information.
- This change aims to improve the overall user experience when navigating the component guide.
* Fix some backslashes
* Fix remaining backslashes
also posts a message to a Discord channel, but waits for user feedback, and\
17
-
only returns `True` if a user explicitly approved the operation from within\
18
-
Discord (e.g., by sending "approve" / "reject" to the bot in response).
11
+
*[discord\_alerter\_post\_step](https://sdkdocs.zenml.io/latest/integration_code_docs/integrations-discord.html#zenml.integrations.discord) takes a string message, posts it to a Discord channel, and returns whether the operation was successful.
12
+
*[discord\_alerter\_ask\_step](https://sdkdocs.zenml.io/latest/integration_code_docs/integrations-discord.html#zenml.integrations.discord) also posts a message to a Discord channel, but waits for user feedback, and only returns `True` if a user explicitly approved the operation from within Discord (e.g., by sending "approve" / "reject" to the bot in response).
19
13
20
14
Interacting with Discord from within your pipelines can be very useful in practice:
21
15
22
-
* The `discord_alerter_post_step` allows you to get notified immediately when failures happen (e.g., model performance\
23
-
degradation, data drift, ...),
24
-
* The `discord_alerter_ask_step` allows you to integrate a human-in-the-loop into your pipelines before executing critical\
25
-
steps, such as deploying new models.
16
+
* The `discord_alerter_post_step` allows you to get notified immediately when failures happen (e.g., model performance degradation, data drift, ...),
17
+
* The `discord_alerter_ask_step` allows you to integrate a human-in-the-loop into your pipelines before executing critical steps, such as deploying new models.
See the [Integrations](https://docs.zenml.io/component-guide) page for more details on ZenML integrations and how to install and\
39
-
use them.
30
+
See the [Integrations](https://docs.zenml.io/component-guide) page for more details on ZenML integrations and how to install and use them.
40
31
{% endhint %}
41
32
42
33
### Setting Up a Discord Bot
43
34
44
-
In order to use the `DiscordAlerter`, you first need to have a Discord workspace set up with a channel that you want your\
45
-
pipelines to post to. This is the `<DISCORD_CHANNEL_ID>` you will need when registering the discord alerter component.
35
+
In order to use the `DiscordAlerter`, you first need to have a Discord workspace set up with a channel that you want your pipelines to post to. This is the `<DISCORD_CHANNEL_ID>` you will need when registering the discord alerter component.
46
36
47
-
Then, you need to [create a Discord App with a bot in your server](https://discordpy.readthedocs.io/en/latest/discord.html)\
48
-
.
37
+
Then, you need to [create a Discord App with a bot in your server](https://discordpy.readthedocs.io/en/latest/discord.html) .
49
38
50
39
{% hint style="info" %}
51
-
Note in the bot token copy step, if you don't find the copy button then click on reset token to reset the bot\
52
-
and you will get a new token which you can use. Also, make sure you give necessary permissions to the bot\
53
-
required for sending and receiving messages.
40
+
Note in the bot token copy step, if you don't find the copy button then click on reset token to reset the bot and you will get a new token which you can use. Also, make sure you give necessary permissions to the bot required for sending and receiving messages.
54
41
{% endhint %}
55
42
56
43
### Registering a Discord Alerter in ZenML
57
44
58
-
Next, you need to register a `discord` alerter in ZenML and link it to the bot you just created. You can do this with the\
59
-
following command:
45
+
Next, you need to register a `discord` alerter in ZenML and link it to the bot you just created. You can do this with the following command:
60
46
61
47
```shell
62
48
zenml alerter register discord_alerter \
@@ -75,8 +61,7 @@ Here is where you can find the required parameters:
75
61
76
62
#### DISCORD\_CHANNEL\_ID
77
63
78
-
Open the discord server, then right-click on the text channel and click on the\
79
-
'Copy Channel ID' option.
64
+
Open the discord server, then right-click on the text channel and click on the 'Copy Channel ID' option.
80
65
81
66
{% hint style="info" %}
82
67
If you don't see any 'Copy Channel ID' option for your channel, go to "User Settings" > "Advanced" and make sure "Developer Mode" is active.
@@ -87,8 +72,7 @@ If you don't see any 'Copy Channel ID' option for your channel, go to "User Sett
87
72
This is the Discord token of your bot. You can find the instructions on how to set up a bot, invite it to your channel, and find its token[here](https://discordpy.readthedocs.io/en/latest/discord.html).
88
73
89
74
{% hint style="warning" %}
90
-
When inviting the bot to your channel, make sure it has at least the following\
91
-
permissions:
75
+
When inviting the bot to your channel, make sure it has at least the following permissions:
92
76
93
77
* Read Messages/View Channels
94
78
* Send Messages
@@ -97,14 +81,9 @@ permissions:
97
81
98
82
### How to Use the Discord Alerter
99
83
100
-
After you have a `DiscordAlerter` configured in your stack, you can directly import\
101
-
the [discord\_alerter\_post\_step](https://sdkdocs.zenml.io/latest/integration_code_docs/integrations-discord.html#zenml.integrations.discord)\
102
-
and [discord\_alerter\_ask\_step](https://sdkdocs.zenml.io/latest/integration_code_docs/integrations-discord.html#zenml.integrations.discord)\
103
-
steps and use them in your pipelines.
84
+
After you have a `DiscordAlerter` configured in your stack, you can directly import the [discord\_alerter\_post\_step](https://sdkdocs.zenml.io/latest/integration_code_docs/integrations-discord.html#zenml.integrations.discord) and [discord\_alerter\_ask\_step](https://sdkdocs.zenml.io/latest/integration_code_docs/integrations-discord.html#zenml.integrations.discord) steps and use them in your pipelines.
104
85
105
-
Since these steps expect a string message as input (which needs to be the output of another step), you typically also\
106
-
need to define a dedicated formatter step that takes whatever data you want to communicate and generates the string\
107
-
message that the alerter should post.
86
+
Since these steps expect a string message as input (which needs to be the output of another step), you typically also need to define a dedicated formatter step that takes whatever data you want to communicate and generates the string message that the alerter should post.
108
87
109
88
As an example, adding `discord_alerter_ask_step()` to your pipeline could look like this:
110
89
@@ -130,8 +109,6 @@ if __name__ == "__main__":
130
109
my_pipeline()
131
110
```
132
111
133
-
For more information and a full list of configurable attributes of the Discord alerter, check out\
134
-
the [SDK Docs](https://sdkdocs.zenml.io/latest/integration_code_docs/integrations-discord.html#zenml.integrations.discord)\
135
-
.
112
+
For more information and a full list of configurable attributes of the Discord alerter, check out the [SDK Docs](https://sdkdocs.zenml.io/latest/integration_code_docs/integrations-discord.html#zenml.integrations.discord) .
Argilla distinguishes itself for its focus on specific use cases and\
12
-
human-in-the-loop approaches. While it does offer programmatic features,\
13
-
Argilla's core value lies in actively involving human experts in the\
14
-
tool-building process, setting it apart from other competitors.
11
+
Argilla distinguishes itself for its focus on specific use cases and human-in-the-loop approaches. While it does offer programmatic features, Argilla's core value lies in actively involving human experts in the tool-building process, setting it apart from other competitors.
15
12
16
13
### When would you want to use it?
17
14
18
-
If you need to label textual data as part of your ML workflow, that is the point\
19
-
at which you could consider adding the Argilla annotator stack component as part\
20
-
of your ZenML stack.
15
+
If you need to label textual data as part of your ML workflow, that is the point at which you could consider adding the Argilla annotator stack component as part of your ZenML stack.
21
16
22
-
We currently support the use of annotation at the various stages described in[the main annotators docs page](./). The Argilla integration\
23
-
currently is built to support annotation using a local (Docker-backed) instance\
24
-
of Argilla as well as a deployed instance of Argilla. There is an easy way to\
We currently support the use of annotation at the various stages described in[the main annotators docs page](./). The Argilla integration currently is built to support annotation using a local (Docker-backed) instance of Argilla as well as a deployed instance of Argilla. There is an easy way to deploy Argilla as a [Hugging Face Space](https://huggingface.co/docs/hub/spaces-sdks-docker-argilla), for instance, which is documented in the [Argilla documentation](https://docs.argilla.io/latest/getting_started/quickstart/).
29
18
30
19
### How to deploy it?
31
20
32
-
The Argilla Annotator flavor is provided by the Argilla ZenML integration. You\
33
-
need to install it to be able to register it as an Annotator and add it to your\
34
-
stack:
21
+
The Argilla Annotator flavor is provided by the Argilla ZenML integration. You need to install it to be able to register it as an Annotator and add it to your stack:
35
22
36
23
```shell
37
24
zenml integration install argilla
38
25
```
39
26
40
-
You can either pass the `api_key` directly into the `zenml annotator register`\
41
-
command or you can register it as a secret and pass the secret name into the\
42
-
command. We recommend the latter approach for security reasons. If you want to\
43
-
take the latter approach, be sure to register a secret for whichever artifact\
44
-
store you choose, and then you should make sure to pass the name of that secret\
45
-
into the annotator as the `--authentication_secret`. For example, you'd run:
27
+
You can either pass the `api_key` directly into the `zenml annotator register` command or you can register it as a secret and pass the secret name into the command. We recommend the latter approach for security reasons. If you want to take the latter approach, be sure to register a secret for whichever artifact store you choose, and then you should make sure to pass the name of that secret into the annotator as the `--authentication_secret`. For example, you'd run:
When using a deployed instance of Argilla, the instance URL must be specified\
60
-
without any trailing `/` at the end. If you are using a Hugging Face Spaces\
61
-
instance and its visibility is set to private, you must also set the`headers` parameter which would include a Hugging Face token. For example:
41
+
When using a deployed instance of Argilla, the instance URL must be specified without any trailing `/` at the end. If you are using a Hugging Face Spaces instance and its visibility is set to private, you must also set the`headers` parameter which would include a Hugging Face token. For example:
Finally, add all these components to a stack and set it as your active stack.\
68
-
For example:
47
+
Finally, add all these components to a stack and set it as your active stack. For example:
69
48
70
49
```shell
71
50
zenml stack copy default annotation
@@ -76,41 +55,23 @@ zenml stack set annotation
76
55
zenml stack describe
77
56
```
78
57
79
-
Now if you run a simple CLI command like `zenml annotator dataset list` this\
80
-
should work without any errors. You're ready to use your annotator in your ML\
81
-
workflow!
58
+
Now if you run a simple CLI command like `zenml annotator dataset list` this should work without any errors. You're ready to use your annotator in your ML workflow!
82
59
83
60
### How do you use it?
84
61
85
-
ZenML supports access to your data and annotations via the `zenml annotator ...`\
86
-
CLI command. We have also implemented an interface to some of the common Argilla\
87
-
functionality via the ZenML SDK.
62
+
ZenML supports access to your data and annotations via the `zenml annotator ...` CLI command. We have also implemented an interface to some of the common Argilla functionality via the ZenML SDK.
88
63
89
-
You can access information about the datasets you're using with the `zenml annotator dataset list`. To work on annotation for a particular dataset, you can\
90
-
run `zenml annotator dataset annotate <dataset_name>`. This will open the Argilla\
91
-
web interface for you to start annotating the dataset.
64
+
You can access information about the datasets you're using with the `zenml annotator dataset list`. To work on annotation for a particular dataset, you can run `zenml annotator dataset annotate <dataset_name>`. This will open the Argilla web interface for you to start annotating the dataset.
92
65
93
66
#### Argilla Annotator Stack Component
94
67
95
-
Our Argilla annotator component inherits from the `BaseAnnotator` class. There\
96
-
are some methods that are core methods that must be defined, like being able to\
97
-
register or get a dataset. Most annotators handle things like the storage of\
98
-
state and have their own custom features, so there are quite a few extra methods\
99
-
specific to Argilla.
68
+
Our Argilla annotator component inherits from the `BaseAnnotator` class. There are some methods that are core methods that must be defined, like being able to register or get a dataset. Most annotators handle things like the storage of state and have their own custom features, so there are quite a few extra methods specific to Argilla.
100
69
101
-
The core Argilla functionality that's currently enabled includes a way to\
102
-
register your datasets, export any annotations for use in separate steps as well\
103
-
as start the annotator daemon process. (Argilla requires a server to be running\
104
-
in order to use the web interface, and ZenML handles the connection to this\
105
-
server using the details you passed in when registering the component.)
70
+
The core Argilla functionality that's currently enabled includes a way to register your datasets, export any annotations for use in separate steps as well as start the annotator daemon process. (Argilla requires a server to be running in order to use the web interface, and ZenML handles the connection to this server using the details you passed in when registering the component.)
to learn more about the methods that ZenML exposes for the Argilla annotator. To\
112
-
access the SDK through Python, you would first get the client object and then\
113
-
call the methods you need. For example:
74
+
Visit [the SDK docs](https://sdkdocs.zenml.io/latest/integration_code_docs/integrations-argilla/) to learn more about the methods that ZenML exposes for the Argilla annotator. To access the SDK through Python, you would first get the client object and then call the methods you need. For example:
For more detailed information on how to use the Argilla annotator and the functionality it provides, visit the [Argilla documentation](https://docs.argilla.io/en/latest/).
0 commit comments