MCPcopy Create free account
hub / github.com/FunAudioLLM/FunMusic / batch

Function batch

inspiremusic/dataset/processor.py:438–452  ·  view source on GitHub ↗

Wrapper for static/dynamic batch

(data, batch_type='static', batch_size=16, max_frames_in_batch=12000,
		  mode='train')

Source from the content-addressed store, hash-verified

436
437
438def batch(data, batch_type='static', batch_size=16, max_frames_in_batch=12000,
439 mode='train'):
440 """ Wrapper for static/dynamic batch
441 """
442 if mode == 'inference':
443 return static_batch(data, 1)
444 elif mode == 'processing':
445 return static_batch(data, batch_size)
446 else:
447 if batch_type == 'static':
448 return static_batch(data, batch_size)
449 elif batch_type == 'dynamic':
450 return dynamic_batch(data, max_frames_in_batch)
451 else:
452 logging.fatal('Unsupported batch type {}'.format(batch_type))
453
454
455def padding(data, mode='train'):

Callers

nothing calls this directly

Calls 2

static_batchFunction · 0.85
dynamic_batchFunction · 0.85

Tested by

no test coverage detected