Fix pipeline sample output
Browse files- pipeline.py +8 -6
pipeline.py
CHANGED
|
@@ -22,12 +22,14 @@ class PreTrainedPipeline():
|
|
| 22 |
|
| 23 |
self.model = model
|
| 24 |
|
| 25 |
-
def __call__(self, inputs):
|
| 26 |
-
return [
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
| 31 |
]
|
| 32 |
|
| 33 |
# def RevDict(sent,flag,model):
|
|
|
|
| 22 |
|
| 23 |
self.model = model
|
| 24 |
|
| 25 |
+
def __call__(self, inputs: str):
|
| 26 |
+
return [
|
| 27 |
+
[ # Sample output, call the model here TODO
|
| 28 |
+
{'label': 'POSITIVE', 'score': 0.05},
|
| 29 |
+
{'label': 'NEGATIVE', 'score': 0.03},
|
| 30 |
+
{'label': 'معنی', 'score': 0.92},
|
| 31 |
+
{'label': f'{inputs}', 'score': 0},
|
| 32 |
+
]
|
| 33 |
]
|
| 34 |
|
| 35 |
# def RevDict(sent,flag,model):
|