Unverified Commit 9deb18ca authored by dg845's avatar dg845 Committed by GitHub
Browse files

Add # Copied from statements to audio feature extractors that use the floats_list function (#26581)

Add # Copied from statements to audio feature extractors that use the floats_list function.
parent 0a49f909
...@@ -33,6 +33,7 @@ if is_torch_available(): ...@@ -33,6 +33,7 @@ if is_torch_available():
import torch import torch
# Copied from tests.models.whisper.test_feature_extraction_whisper.floats_list
def floats_list(shape, scale=1.0, rng=None, name=None): def floats_list(shape, scale=1.0, rng=None, name=None):
"""Creates a random float32 tensor""" """Creates a random float32 tensor"""
if rng is None: if rng is None:
......
...@@ -34,6 +34,7 @@ if is_torch_available(): ...@@ -34,6 +34,7 @@ if is_torch_available():
global_rng = random.Random() global_rng = random.Random()
# Copied from tests.models.whisper.test_feature_extraction_whisper.floats_list
def floats_list(shape, scale=1.0, rng=None, name=None): def floats_list(shape, scale=1.0, rng=None, name=None):
"""Creates a random float32 tensor""" """Creates a random float32 tensor"""
if rng is None: if rng is None:
......
...@@ -35,6 +35,7 @@ if is_speech_available(): ...@@ -35,6 +35,7 @@ if is_speech_available():
global_rng = random.Random() global_rng = random.Random()
# Copied from tests.models.whisper.test_feature_extraction_whisper.floats_list
def floats_list(shape, scale=1.0, rng=None, name=None): def floats_list(shape, scale=1.0, rng=None, name=None):
"""Creates a random float32 tensor""" """Creates a random float32 tensor"""
if rng is None: if rng is None:
......
...@@ -32,6 +32,7 @@ if is_speech_available(): ...@@ -32,6 +32,7 @@ if is_speech_available():
global_rng = random.Random() global_rng = random.Random()
# Copied from tests.models.whisper.test_feature_extraction_whisper.floats_list
def floats_list(shape, scale=1.0, rng=None, name=None): def floats_list(shape, scale=1.0, rng=None, name=None):
"""Creates a random float32 tensor""" """Creates a random float32 tensor"""
if rng is None: if rng is None:
......
...@@ -34,6 +34,7 @@ if is_torch_available(): ...@@ -34,6 +34,7 @@ if is_torch_available():
global_rng = random.Random() global_rng = random.Random()
# Copied from tests.models.whisper.test_feature_extraction_whisper.floats_list
def floats_list(shape, scale=1.0, rng=None, name=None): def floats_list(shape, scale=1.0, rng=None, name=None):
"""Creates a random float32 tensor""" """Creates a random float32 tensor"""
if rng is None: if rng is None:
......
...@@ -38,6 +38,7 @@ if is_datasets_available(): ...@@ -38,6 +38,7 @@ if is_datasets_available():
global_rng = random.Random() global_rng = random.Random()
# Copied from tests.models.whisper.test_feature_extraction_whisper.floats_list
def floats_list(shape, scale=1.0, rng=None, name=None): def floats_list(shape, scale=1.0, rng=None, name=None):
"""Creates a random float32 tensor""" """Creates a random float32 tensor"""
if rng is None: if rng is None:
......
...@@ -29,6 +29,7 @@ from ...test_sequence_feature_extraction_common import SequenceFeatureExtraction ...@@ -29,6 +29,7 @@ from ...test_sequence_feature_extraction_common import SequenceFeatureExtraction
global_rng = random.Random() global_rng = random.Random()
# Copied from tests.models.whisper.test_feature_extraction_whisper.floats_list
def floats_list(shape, scale=1.0, rng=None, name=None): def floats_list(shape, scale=1.0, rng=None, name=None):
"""Creates a random float32 tensor""" """Creates a random float32 tensor"""
if rng is None: if rng is None:
......
...@@ -39,6 +39,7 @@ from ...test_tokenization_common import TokenizerTesterMixin ...@@ -39,6 +39,7 @@ from ...test_tokenization_common import TokenizerTesterMixin
global_rng = random.Random() global_rng = random.Random()
# Copied from tests.models.whisper.test_feature_extraction_whisper.floats_list
def floats_list(shape, scale=1.0, rng=None, name=None): def floats_list(shape, scale=1.0, rng=None, name=None):
"""Creates a random float32 tensor""" """Creates a random float32 tensor"""
if rng is None: if rng is None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment