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
Copy file name to clipboardExpand all lines: docs/README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,7 @@ When adding a new pipeline:
128
128
- Possible an end-to-end example of how to use it
129
129
- Add all the pipeline classes that should be linked in the diffusion model. These classes should be added using our Markdown syntax. By default as follows:
130
130
131
-
```
131
+
```py
132
132
## XXXPipeline
133
133
134
134
[[autodoc]] XXXPipeline
@@ -138,7 +138,7 @@ When adding a new pipeline:
138
138
139
139
This will include every public method of the pipeline that is documented, as well as the `__call__` method that is not documented by default. If you just want to add additional methods that are not documented, you can put the list of all methods to add in a list that contains `all`.
140
140
141
-
```
141
+
```py
142
142
[[autodoc]] XXXPipeline
143
143
-all
144
144
-__call__
@@ -172,7 +172,7 @@ Arguments should be defined with the `Args:` (or `Arguments:` or `Parameters:`)
172
172
an indentation. The argument should be followed by its type, with its shape if it is a tensor, a colon, and its
173
173
description:
174
174
175
-
```
175
+
```py
176
176
Args:
177
177
n_layers (`int`): The number of layers of the model.
178
178
```
@@ -182,7 +182,7 @@ after the argument.
182
182
183
183
Here's an example showcasing everything so far:
184
184
185
-
```
185
+
```py
186
186
Args:
187
187
input_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`):
188
188
Indices of input sequence tokens in the vocabulary.
@@ -196,13 +196,13 @@ Here's an example showcasing everything so far:
196
196
For optional arguments or arguments with defaults we follow the following syntax: imagine we have a function with the
197
197
following signature:
198
198
199
-
```
199
+
```py
200
200
def my_function(x: str=None, a: float=1):
201
201
```
202
202
203
203
then its documentation should look like this:
204
204
205
-
```
205
+
```py
206
206
Args:
207
207
x (`str`, *optional*):
208
208
This argument controls ...
@@ -235,14 +235,14 @@ building the return.
235
235
236
236
Here's an example of a single value return:
237
237
238
-
```
238
+
```py
239
239
Returns:
240
240
`List[int]`: A list of integers in the range [0, 1] ---1for a special token, 0for a sequence token.
241
241
```
242
242
243
243
Here's an example of a tuple return, comprising several objects:
244
244
245
-
```
245
+
```py
246
246
Returns:
247
247
`tuple(torch.FloatTensor)` comprising various elements depending on the configuration ([`BertConfig`]) and inputs:
248
248
-** loss** (*optional*, returned when `masked_lm_labels`is provided) `torch.FloatTensor` of shape `(1,)`--
0 commit comments