Skip to content

Commit 9cba7be

Browse files
authored
Fix the backslash problem (#3439)
* 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
1 parent 37e233a commit 9cba7be

File tree

28 files changed

+200
-652
lines changed

28 files changed

+200
-652
lines changed

docs/book/component-guide/alerters/discord.md

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,17 @@ description: Sending automated alerts to a Discord channel.
44

55
# Discord Alerter
66

7-
The `DiscordAlerter` enables you to send messages to a dedicated Discord channel\
8-
directly from within your ZenML pipelines.
7+
The `DiscordAlerter` enables you to send messages to a dedicated Discord channel directly from within your ZenML pipelines.
98

109
The `discord` integration contains the following two standard steps:
1110

12-
* [discord\_alerter\_post\_step](https://sdkdocs.zenml.io/latest/integration_code_docs/integrations-discord.html#zenml.integrations.discord)\
13-
takes a string message, posts it to a Discord channel, and returns whether the\
14-
operation was successful.
15-
* [discord\_alerter\_ask\_step](https://sdkdocs.zenml.io/latest/integration_code_docs/integrations-discord.html#zenml.integrations.discord)\
16-
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).
1913

2014
Interacting with Discord from within your pipelines can be very useful in practice:
2115

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.
2618

2719
## How to use it
2820

@@ -35,28 +27,22 @@ zenml integration install discord -y
3527
```
3628

3729
{% hint style="info" %}
38-
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.
4031
{% endhint %}
4132

4233
### Setting Up a Discord Bot
4334

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.
4636

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) .
4938

5039
{% 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.
5441
{% endhint %}
5542

5643
### Registering a Discord Alerter in ZenML
5744

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:
6046

6147
```shell
6248
zenml alerter register discord_alerter \
@@ -75,8 +61,7 @@ Here is where you can find the required parameters:
7561

7662
#### DISCORD\_CHANNEL\_ID
7763

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.
8065

8166
{% hint style="info" %}
8267
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
8772
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).
8873

8974
{% 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:
9276

9377
* Read Messages/View Channels
9478
* Send Messages
@@ -97,14 +81,9 @@ permissions:
9781

9882
### How to Use the Discord Alerter
9983

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.
10485

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.
10887

10988
As an example, adding `discord_alerter_ask_step()` to your pipeline could look like this:
11089

@@ -130,8 +109,6 @@ if __name__ == "__main__":
130109
my_pipeline()
131110
```
132111

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) .
136113

137114
<figure><img src="https://static.scarf.sh/a.png?x-pxid=f0b4f458-0a54-4fcd-aa95-d5ee424815bc" alt="ZenML Scarf"><figcaption></figcaption></figure>

docs/book/component-guide/annotators/argilla.md

Lines changed: 14 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,23 @@ description: Annotating data using Argilla.
88

99
![Argilla Annotator](../../.gitbook/assets/argilla_annotator.png)
1010

11-
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.
1512

1613
### When would you want to use it?
1714

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.
2116

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\
25-
deploy Argilla as a [Hugging Face\
26-
Space](https://huggingface.co/docs/hub/spaces-sdks-docker-argilla), for\
27-
instance, which is documented in the [Argilla\
28-
documentation](https://docs.argilla.io/latest/getting_started/quickstart/).
17+
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/).
2918

3019
### How to deploy it?
3120

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:
3522

3623
```shell
3724
zenml integration install argilla
3825
```
3926

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:
4628

4729
```shell
4830
zenml secret create argilla_secrets --api_key="<your_argilla_api_key>"
@@ -56,16 +38,13 @@ Then register your annotator with ZenML:
5638
zenml annotator register argilla --flavor argilla --authentication_secret=argilla_secrets --port=6900
5739
```
5840

59-
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:
6242

6343
```shell
6444
zenml annotator register argilla --flavor argilla --authentication_secret=argilla_secrets --instance_url="https://[your-owner-name]-[your_space_name].hf.space" --headers='{"Authorization": "Bearer {[your_hugging_face_token]}"}'
6545
```
6646

67-
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:
6948

7049
```shell
7150
zenml stack copy default annotation
@@ -76,41 +55,23 @@ zenml stack set annotation
7655
zenml stack describe
7756
```
7857

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!
8259

8360
### How do you use it?
8461

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.
8863

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.
9265

9366
#### Argilla Annotator Stack Component
9467

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.
10069

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.)
10671

10772
#### Argilla Annotator SDK
10873

109-
Visit [the SDK\
110-
docs](https://sdkdocs.zenml.io/latest/integration_code_docs/integrations-argilla/)\
111-
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:
11475

11576
```python
11677
from zenml.client import Client
@@ -128,8 +89,6 @@ dataset = annotator.get_dataset("dataset_name")
12889
annotations = annotator.get_labeled_data(dataset_name="dataset_name")
12990
```
13091

131-
For more detailed information on how to use the Argilla annotator and the\
132-
functionality it provides, visit the [Argilla\
133-
documentation](https://docs.argilla.io/en/latest/).
92+
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/).
13493

13594
<figure><img src="https://static.scarf.sh/a.png?x-pxid=f0b4f458-0a54-4fcd-aa95-d5ee424815bc" alt="ZenML Scarf"><figcaption></figcaption></figure>

0 commit comments

Comments
 (0)