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

Function random_sampling

inspiremusic/utils/common.py:188–190  ·  view source on GitHub ↗
(weighted_scores, decoded_tokens)

Source from the content-addressed store, hash-verified

186
187
188def random_sampling(weighted_scores, decoded_tokens):
189 top_ids = weighted_scores.softmax(dim=0).multinomial(1, replacement=True)
190 return top_ids
191
192
193def fade_in_out(fade_in_mel, fade_out_mel, window):

Callers 4

topk_samplingFunction · 0.85
ras_samplingFunction · 0.85
caras_samplingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected