Spaces:
Runtime error
Runtime error
Handle different model output sizes
Browse files
app.py
CHANGED
@@ -136,7 +136,12 @@ def process_func(x: np.ndarray, sampling_rate: int) -> dict:
|
|
136 |
# run through model
|
137 |
with torch.no_grad():
|
138 |
y = model(y)
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
# convert to numpy
|
142 |
y = y.detach().cpu().numpy()
|
|
|
136 |
# run through model
|
137 |
with torch.no_grad():
|
138 |
y = model(y)
|
139 |
+
if len(y) == 2:
|
140 |
+
# Age-gender model
|
141 |
+
y = torch.hstack([y[1], y[2]])
|
142 |
+
else:
|
143 |
+
# Expression model
|
144 |
+
y = y[1]
|
145 |
|
146 |
# convert to numpy
|
147 |
y = y.detach().cpu().numpy()
|