File size: 813 Bytes
1dc0a7f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
from huggingface_hub import login
from datasets import load_dataset
from datasets import Audio
import json
def get_credentials():
with open("credentials.json","r") as f:
credentials = json.load(f)
return credentials['token']
class Dataset:
def __init__(self, n:int=100):
# # Log the client into HF
# login(token=get_credentials())
# # Load the Dataset in Streaming Mode
# self.librispeech_clean = load_dataset("librispeech_asr", "all", split="test.clean", streaming=True)
# self.librispeech_other = load_dataset("librispeech_asr", "all", split="test.other", streaming=True)
self.n = n
self.options = ['librisspeech_clean','librisspeech_other']
def get_option(self):
return self.options
dataset = Dataset() |