Spaces:
Runtime error
Runtime error
Commit
·
8a139e3
1
Parent(s):
9467051
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ num_to_char = layers.StringLookup(
|
|
31 |
def decode_batch_predictions(pred):
|
32 |
input_len = np.ones(pred.shape[0]) * pred.shape[1]
|
33 |
# Use greedy search. For complex tasks, you can use beam search
|
34 |
-
results = keras.backend.ctc_decode(pred, input_length=input_len, greedy=False)[0][0][
|
35 |
:, :max_length
|
36 |
]
|
37 |
# Iterate over the results and get back the text
|
|
|
31 |
def decode_batch_predictions(pred):
|
32 |
input_len = np.ones(pred.shape[0]) * pred.shape[1]
|
33 |
# Use greedy search. For complex tasks, you can use beam search
|
34 |
+
results = keras.backend.ctc_decode(pred, input_length=input_len, greedy=False, beam_width=5)[0][0][
|
35 |
:, :max_length
|
36 |
]
|
37 |
# Iterate over the results and get back the text
|