Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
500dfb5b
Unverified
Commit
500dfb5b
authored
Sep 19, 2023
by
Nino Risteski
Committed by
GitHub
Sep 19, 2023
Browse files
Update add_new_pipeline.md (#26197)
fixed a few typos
parent
7d4e0c23
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
docs/source/en/add_new_pipeline.md
docs/source/en/add_new_pipeline.md
+6
-6
No files found.
docs/source/en/add_new_pipeline.md
View file @
500dfb5b
...
...
@@ -111,8 +111,8 @@ def _sanitize_parameters(self, **kwargs):
```
Try to keep the inputs/outputs very simple and ideally JSON-serializable as it makes the pipeline usage very easy
without requiring users to understand new kind of objects. It's also relatively common to support many different types
of arguments for ease of use (audio files, can be filenames, URLs or pure bytes)
without requiring users to understand new kind
s
of objects. It's also relatively common to support many different types
of arguments for ease of use (audio files,
which
can be filenames, URLs or pure bytes)
...
...
@@ -219,8 +219,8 @@ repo.push_to_hub()
```
This will copy the file where you defined
`PairClassificationPipeline`
inside the folder
`"test-dynamic-pipeline"`
,
along with saving the model and tokenizer of the pipeline, before pushing everything in the repository
`{your_username}/test-dynamic-pipeline`
. After that anyone can use it as long as they provide the option
along with saving the model and tokenizer of the pipeline, before pushing everything in
to
the repository
`{your_username}/test-dynamic-pipeline`
. After that
,
anyone can use it as long as they provide the option
`trust_remote_code=True`
:
```
py
...
...
@@ -232,9 +232,9 @@ classifier = pipeline(model="{your_username}/test-dynamic-pipeline", trust_remot
## Add the pipeline to 🤗 Transformers
If you want to contribute your pipeline to 🤗 Transformers, you will need to add a new module in the
`pipelines`
submodule
with the code of your pipeline, then add it
in
the list of tasks defined in
`pipelines/__init__.py`
.
with the code of your pipeline, then add it
to
the list of tasks defined in
`pipelines/__init__.py`
.
Then you will need to add tests. Create a new file
`tests/test_pipelines_MY_PIPELINE.py`
with example
with
the other tests.
Then you will need to add tests. Create a new file
`tests/test_pipelines_MY_PIPELINE.py`
with example
s of
the other tests.
The
`run_pipeline_test`
function will be very generic and run on small random models on every possible
architecture as defined by
`model_mapping`
and
`tf_model_mapping`
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment