Commit
·
9bc671f
1
Parent(s):
ad5aa37
Update app.py
Browse files
app.py
CHANGED
@@ -259,7 +259,7 @@ def translate_sign_language(gesture):
|
|
259 |
|
260 |
idx_to_label = model_pretrained.config.id2label
|
261 |
#gesture_translation = predicted_prod_label.cpu().numpy()
|
262 |
-
gesture_translation = idx_to_label[predicted_prod_label.cpu().numpy()]
|
263 |
|
264 |
#for val in np.array(predicted_prod_label.cpu().numpy()):
|
265 |
# gesture_translation = idx_to_label[val]
|
|
|
259 |
|
260 |
idx_to_label = model_pretrained.config.id2label
|
261 |
#gesture_translation = predicted_prod_label.cpu().numpy()
|
262 |
+
gesture_translation = idx_to_label[predicted_prod_label.cpu().numpy().item()] # Convert to a scalar
|
263 |
|
264 |
#for val in np.array(predicted_prod_label.cpu().numpy()):
|
265 |
# gesture_translation = idx_to_label[val]
|