binaryaaron commited on
Commit
ad76447
1 Parent(s): 2e3949d

update handler and requirements.txt

Browse files
Files changed (2) hide show
  1. handler.py +8 -2
  2. requirements.txt +1 -2
handler.py CHANGED
@@ -13,10 +13,16 @@ class EndpointHandler(object):
13
  device_map="auto",
14
  )
15
 
16
- def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
 
 
 
 
 
 
17
  inputs = data.pop("inputs")
18
 
19
- if parameters:= data.pop("parameters", None):
20
  outputs = self.pipeline(
21
  inputs,
22
  **parameters
 
13
  device_map="auto",
14
  )
15
 
16
+ def __call__(self, data: Dict[str, Any]) -> List[List[Dict[str, float]]]:
17
+ """
18
+ :param data:
19
+ inputs: message format
20
+ parameters: parameters for the pipeline
21
+ :return:
22
+ """
23
  inputs = data.pop("inputs")
24
 
25
+ if parameters:= data.pop("parameters") is not None:
26
  outputs = self.pipeline(
27
  inputs,
28
  **parameters
requirements.txt CHANGED
@@ -1,2 +1 @@
1
- transformers[sklearn,sentencepiece,audio,vision,sentencepiece]==4.46.1
2
- huggingface-inference-toolkit==0.5.2
 
1
+ transformers[sklearn,sentencepiece,audio,vision,sentencepiece]==4.46.1