sanchit-gandhi HF staff commited on
Commit
aa3b8d4
1 Parent(s): fee1424

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -93,7 +93,11 @@ if __name__ == "__main__":
93
 
94
  dataloader = processor.preprocess_batch(inputs, chunk_length_s=CHUNK_LENGTH_S, batch_size=BATCH_SIZE)
95
 
96
- model_outputs = pool.map(partial(forward, task=task, return_timestamps=return_timestamps), dataloader)
 
 
 
 
97
 
98
  post_processed = processor.postprocess(model_outputs, return_timestamps=return_timestamps)
99
  timestamps = post_processed.get("chunks")
 
93
 
94
  dataloader = processor.preprocess_batch(inputs, chunk_length_s=CHUNK_LENGTH_S, batch_size=BATCH_SIZE)
95
 
96
+ try:
97
+ model_outputs = pool.map(partial(forward, task=task, return_timestamps=return_timestamps), dataloader)
98
+ except ValueError as err:
99
+ # pre-processor does all the necessary compatibility checks for our audio inputs
100
+ return err, None
101
 
102
  post_processed = processor.postprocess(model_outputs, return_timestamps=return_timestamps)
103
  timestamps = post_processed.get("chunks")