Closed Xinyi-Cheng closed 6 months ago
Thank you very much for your contribution and clear explanation, it's perfect.
Please remove all the .DS_Store
file from the PR, and this is ready to be merged.
Hi, sorry for .DS_Store
files. I have corrected them in the latest commit.
This commit addresses a specific
TypeError
encountered in theLibriMix.__getitem__
method when using therandom.randint
function. The error was triggered by passing anumpy.float64
type argument torandom.randint
, which expects integer arguments to generate a random integer between two specified integer values. The problematic code snippet was:Here, the operation between
row["length"]
andself.seg_len
could result in a floating-point number, whilerandom.randint
requires integer inputs. To resolve this issue, the code has been modified to explicitly convert the result ofrow["length"] - self.seg_len
to an integer using theint()
function, as shown below:This modification ensures that the input to
random.randint
is always an integer, irrespective of the original data types involved, thus preventing theTypeError
.