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