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
@@ -57,8 +57,8 @@ You can find a complete walkhrough Optimum Inference for ONNX Runtime in this [n
57
57
58
58
### Working with the Hugging Face Model Hub
59
59
60
-
The Optimum model classes like [`~onnxruntime.ORTModelForSequenceClassification`] are integrated with the [Hugging Face Model Hub](https://hf.co/models), which means you can not only
61
-
load model from the Hub, but also push your models to the Hub with `push_to_hub()` method. Below is an example which downloads a vanilla Transformers model
60
+
The Optimum model classes like [`~onnxruntime.ORTModelForSequenceClassification`] are integrated with the [Hugging Face Model Hub](https://hf.co/models), which means you can not only
61
+
load model from the Hub, but also push your models to the Hub with `push_to_hub()` method. Below is an example which downloads a vanilla Transformers model
62
62
from the Hub and converts it to an optimum onnxruntime model and pushes it back into a new repository.
63
63
64
64
<!-- TODO: Add Quantizer into example when UX improved -->
@@ -105,3 +105,7 @@ from the Hub and converts it to an optimum onnxruntime model and pushes it back
@@ -46,7 +46,7 @@ The [`~pipelines.pipeline`] function automatically loads a default model and tok
46
46
47
47
```
48
48
49
-
2. Pass your input text to the [`~pipelines.pipeline`] function:
49
+
2. Pass your input text/image to the [`~pipelines.pipeline`] function:
50
50
51
51
```python
52
52
>>> classifier("I like you. I love you.")
@@ -57,9 +57,9 @@ _Note: The default models used in the [`~pipelines.pipeline`] function are not o
57
57
58
58
### Using vanilla Transformers model and converting to ONNX
59
59
60
-
The [`~pipelines.pipeline`] function accepts any supported model from the [Model Hub](https://huggingface.co/models).
61
-
There are tags on the Model Hub that allow you to filter for a model you'd like to use for your task.
62
-
Once you've picked an appropriate model, load it with the `from_pretrained("{model_id}",from_transformers=True)` method associated with the `ORTModelFor*`
60
+
The [`~pipelines.pipeline`] function accepts any supported model from the [Model Hub](https://huggingface.co/models).
61
+
There are tags on the Model Hub that allow you to filter for a model you'd like to use for your task.
62
+
Once you've picked an appropriate model, load it with the `from_pretrained("{model_id}",from_transformers=True)` method associated with the `ORTModelFor*`
63
63
`AutoTokenizer' class. For example, here's how you can load the [`~onnxruntime.ORTModelForQuestionAnswering`] class for question answering:
64
64
65
65
```python
@@ -80,10 +80,10 @@ Once you've picked an appropriate model, load it with the `from_pretrained("{mod
80
80
81
81
### Using Optimum models
82
82
83
-
The [`~pipelines.pipeline`] function is tightly integrated with [Model Hub](https://huggingface.co/models) and can load optimized models directly, e.g. those created with ONNX Runtime.
84
-
There are tags on the Model Hub that allow you to filter for a model you'd like to use for your task.
83
+
The [`~pipelines.pipeline`] function is tightly integrated with [Model Hub](https://huggingface.co/models) and can load optimized models directly, e.g. those created with ONNX Runtime.
84
+
There are tags on the Model Hub that allow you to filter for a model you'd like to use for your task.
85
85
Once you've picked an appropriate model, load it with the `from_pretrained()` method associated with the corresponding `ORTModelFor*`
86
-
and `AutoTokenizer' class. For example, here's how you can load an optimized model for question answering:
86
+
and `AutoTokenizer'/`AutoFeatureExtractor` class. For example, here's how you can load an optimized model for question answering:
87
87
88
88
```python
89
89
>>>from transformers import AutoTokenizer
@@ -132,7 +132,7 @@ Below you can find two examples on how you could [`~onnxruntime.ORTOptimizer`] a
# load optimized model from local path or repository
182
182
>>> model = ORTModelForSequenceClassification.from_pretrained(save_path,file_name="model-optimized.onnx")
@@ -198,16 +198,16 @@ Below you can find two examples on how you could [`~onnxruntime.ORTOptimizer`] a
198
198
## Transformers pipeline usage
199
199
200
200
The [`~pipelines.pipeline`] function is just a light wrapper around the `transformers.pipeline` function to enable checks for supported tasks and additional features
201
-
, like quantization and optimization. This being said you can use the `transformers.pipeline` and just replace your `AutoFor*` with the optimum
202
-
`ORTModelFor*` class.
201
+
, like quantization and optimization. This being said you can use the `transformers.pipeline` and just replace your `AutoModelFor*` with the optimum
0 commit comments