Update handler.py
Browse filesignore_mismatched_sizes=True
- handler.py +4 -1
handler.py
CHANGED
@@ -10,7 +10,10 @@ import av
|
|
10 |
|
11 |
class EndpointHandler:
|
12 |
def __init__(self, model_dir=""):
|
13 |
-
self.model = TimesformerForVideoClassification.from_pretrained(
|
|
|
|
|
|
|
14 |
self.model.classifier = torch.nn.Linear(self.model.classifier.in_features, 48) # 48 output classes
|
15 |
self.model.eval()
|
16 |
|
|
|
10 |
|
11 |
class EndpointHandler:
|
12 |
def __init__(self, model_dir=""):
|
13 |
+
self.model = TimesformerForVideoClassification.from_pretrained(
|
14 |
+
'donghuna/timesformer-base-finetuned-k400-diving48',
|
15 |
+
ignore_mismatched_sizes=True
|
16 |
+
)
|
17 |
self.model.classifier = torch.nn.Linear(self.model.classifier.in_features, 48) # 48 output classes
|
18 |
self.model.eval()
|
19 |
|