zeroshot commited on
Commit
6c63fe2
·
1 Parent(s): 897fb91
Files changed (1) hide show
  1. handler.py +10 -6
handler.py CHANGED
@@ -13,11 +13,15 @@ class EndpointHandler:
13
  Args:
14
  data (:obj:): prediction input text
15
  """
16
- # inputs = data.pop("inputs", data)
17
 
18
- # start = perf_counter()
19
- # prediction = self.pipeline(inputs)
20
- # end = perf_counter()
21
- # latency = end - start
22
 
23
- return {"greeting": "hi"}
 
 
 
 
 
13
  Args:
14
  data (:obj:): prediction input text
15
  """
16
+ inputs = data.pop("inputs", data)
17
 
18
+ start = perf_counter()
19
+ prediction = self.pipeline(inputs)
20
+ end = perf_counter()
21
+ latency = end - start
22
 
23
+ return {
24
+ "labels": prediction.labels,
25
+ "scores": prediction.scores,
26
+ "latency (secs.)": latency
27
+ }