donghuna commited on
Commit
2990f6d
·
verified ·
1 Parent(s): 3a541c8

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +5 -3
handler.py CHANGED
@@ -32,9 +32,11 @@ class EndpointHandler:
32
 
33
  inputs = data.get("inputs")
34
  videos = read_video(inputs)
35
- outputs = self.model(videos)
36
- _, predicted = torch.max(outputs.logits, 1)
37
- return predicted
 
 
38
 
39
  # inputs = data.get("inputs")
40
  # if not inputs:
 
32
 
33
  inputs = data.get("inputs")
34
  videos = read_video(inputs)
35
+ with torch.no_grad():
36
+ outputs = self.model(videos)
37
+ logits = outputs.logits
38
+ _, predicted = torch.max(logits, 1)
39
+ return predicted.tolist()
40
 
41
  # inputs = data.get("inputs")
42
  # if not inputs: