binaryaaron
commited on
Commit
•
0db3c14
1
Parent(s):
ad76447
messing
Browse files- handler.py +4 -2
handler.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
from typing import Dict, List, Any
|
2 |
import transformers
|
3 |
import torch
|
4 |
|
@@ -20,9 +20,11 @@ class EndpointHandler(object):
|
|
20 |
parameters: parameters for the pipeline
|
21 |
:return:
|
22 |
"""
|
|
|
23 |
inputs = data.pop("inputs")
|
|
|
24 |
|
25 |
-
if parameters
|
26 |
outputs = self.pipeline(
|
27 |
inputs,
|
28 |
**parameters
|
|
|
1 |
+
from typing import Dict, List, Any, Optional
|
2 |
import transformers
|
3 |
import torch
|
4 |
|
|
|
20 |
parameters: parameters for the pipeline
|
21 |
:return:
|
22 |
"""
|
23 |
+
print(f"data: {data}")
|
24 |
inputs = data.pop("inputs")
|
25 |
+
parameters: Optional[Dict] = data.pop("parameters", None)
|
26 |
|
27 |
+
if parameters is not None:
|
28 |
outputs = self.pipeline(
|
29 |
inputs,
|
30 |
**parameters
|