"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "91182e3a70bb1d8b0fcaa21885b2eb4a227ad889"
Unverified Commit 16f0b7d7 authored by lewtun's avatar lewtun Committed by GitHub
Browse files

Update ONNX docs (#14904)



* Remove docs for deprecated ONNX export

* Tidy up the CLI help messages

* Revamp ONNX docs

* Update auto-config table

* Use DistilBERT as example for consistency

* Wrap up first pass at ONNX docs

* Fix table check

* Add tweaks and introduction

* Add cross-ref

* Fix missing import

* Fix style

* Add permalinks to ONNX configs

* Clarify role of OrderedDict

* Update docs/source/serialization.mdx
Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>

* Add doctest syntax to code blocks

* Remove permalinks

* Revert "Remove permalinks"

This reverts commit 099701daf0db27823457867938efdb2d4f22a7c1.
Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
parent 704d1fec
This diff is collapsed.
...@@ -23,17 +23,17 @@ from .features import FeaturesManager ...@@ -23,17 +23,17 @@ from .features import FeaturesManager
def main(): def main():
parser = ArgumentParser("Hugging Face ONNX Exporter tool") parser = ArgumentParser("Hugging Face Transformers ONNX exporter")
parser.add_argument("-m", "--model", type=str, required=True, help="Model's name of path on disk to load.") parser.add_argument(
"-m", "--model", type=str, required=True, help="Model ID on huggingface.co or path on disk to load model from."
)
parser.add_argument( parser.add_argument(
"--feature", "--feature",
choices=list(FeaturesManager.AVAILABLE_FEATURES), choices=list(FeaturesManager.AVAILABLE_FEATURES),
default="default", default="default",
help="Export the model with some additional feature.", help="The type of features to export the model with.",
)
parser.add_argument(
"--opset", type=int, default=None, help="ONNX opset version to export the model with (default 12)."
) )
parser.add_argument("--opset", type=int, default=None, help="ONNX opset version to export the model with.")
parser.add_argument( parser.add_argument(
"--atol", type=float, default=None, help="Absolute difference tolerence when validating the model." "--atol", type=float, default=None, help="Absolute difference tolerence when validating the model."
) )
......
...@@ -207,11 +207,11 @@ def get_onnx_model_list(): ...@@ -207,11 +207,11 @@ def get_onnx_model_list():
def check_onnx_model_list(overwrite=False): def check_onnx_model_list(overwrite=False):
"""Check the model list in the serialization.rst is consistent with the state of the lib and maybe `overwrite`.""" """Check the model list in the serialization.mdx is consistent with the state of the lib and maybe `overwrite`."""
current_list, start_index, end_index, lines = _find_text_in_file( current_list, start_index, end_index, lines = _find_text_in_file(
filename=os.path.join(PATH_TO_DOCS, "serialization.mdx"), filename=os.path.join(PATH_TO_DOCS, "serialization.mdx"),
start_prompt="<!--This table is automatically generated by make style, do not fill manually!-->", start_prompt="<!--This table is automatically generated by make style, do not fill manually!-->",
end_prompt="This conversion is handled with the PyTorch version of models ", end_prompt="The ONNX conversion is supported for the PyTorch versions of the models.",
) )
new_list = get_onnx_model_list() new_list = get_onnx_model_list()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment