Spaces:
Runtime error
Runtime error
mwitiderrick
commited on
Commit
•
f11e0b8
1
Parent(s):
67d85a9
Update app.py
Browse files
app.py
CHANGED
@@ -8,8 +8,13 @@ DeepSparse is sparsity-aware inference runtime offering GPU-class performance on
|
|
8 |
The text classification Pipeline, for example, wraps an NLP model with the proper preprocessing and postprocessing pipelines, such as tokenization. Here is a sample code for a question-answering pipeline:
|
9 |
```
|
10 |
from deepsparse import Pipeline
|
11 |
-
pipeline =
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
13 |
print(inference)
|
14 |
```
|
15 |
'''
|
|
|
8 |
The text classification Pipeline, for example, wraps an NLP model with the proper preprocessing and postprocessing pipelines, such as tokenization. Here is a sample code for a question-answering pipeline:
|
9 |
```
|
10 |
from deepsparse import Pipeline
|
11 |
+
pipeline = Pipeline.create(
|
12 |
+
task=task,
|
13 |
+
model_path="zoo:nlp/text_classification/distilbert-none/pytorch/huggingface/mnli/pruned80_quant-none-vnni",
|
14 |
+
model_scheme="mnli",
|
15 |
+
model_config={"hypothesis_template": "This text is related to {}"},
|
16 |
+
)
|
17 |
+
inference = pipeline(sequences= text,labels=['politics', 'public health', 'Europe'],)
|
18 |
print(inference)
|
19 |
```
|
20 |
'''
|