Update testing.py
Browse files- testing.py +2 -7
testing.py
CHANGED
|
@@ -2,13 +2,8 @@ from transformers import Pipeline
|
|
| 2 |
import torch
|
| 3 |
|
| 4 |
class DeclarativePipeline(Pipeline):
|
| 5 |
-
def _sanitize_parameters(self, *
|
| 6 |
-
|
| 7 |
-
if "answer" in kwargs:
|
| 8 |
-
preprocess_kwargs["answer"] = kwargs["answer"]
|
| 9 |
-
if "question" in kwargs:
|
| 10 |
-
preprocess_kwargs["question"] = kwargs["question"]
|
| 11 |
-
return preprocess_kwargs, {}, {}
|
| 12 |
|
| 13 |
def preprocess(self, inputs, question, answer):
|
| 14 |
return self.tokenizer(
|
|
|
|
| 2 |
import torch
|
| 3 |
|
| 4 |
class DeclarativePipeline(Pipeline):
|
| 5 |
+
def _sanitize_parameters(self, *args):
|
| 6 |
+
return args, {}, {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
def preprocess(self, inputs, question, answer):
|
| 9 |
return self.tokenizer(
|