Update handler.py
Browse files- 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 |
-
|
36 |
-
|
37 |
-
|
|
|
|
|
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:
|