yangwang825 commited on
Commit
fb58800
·
verified ·
1 Parent(s): 93d8381

Create arca23k.py

Browse files
Files changed (1) hide show
  1. arca23k.py +48 -0
arca23k.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # coding=utf-8
2
+
3
+ """ARCA23K dataset."""
4
+
5
+
6
+ import os
7
+ import json
8
+ import gzip
9
+ import shutil
10
+ import pathlib
11
+ import logging
12
+ import textwrap
13
+ import datasets
14
+ import itertools
15
+ import typing as tp
16
+ import pandas as pd
17
+ import urllib.request
18
+ from pathlib import Path
19
+ from copy import deepcopy
20
+ from tqdm.auto import tqdm
21
+ from rich.logging import RichHandler
22
+ from huggingface_hub import hf_hub_download
23
+
24
+ logger = logging.getLogger(__name__)
25
+ logger.addHandler(RichHandler())
26
+ logger.setLevel(logging.INFO)
27
+
28
+ VERSION = "0.0.1"
29
+
30
+ SAMPLE_RATE = 44_100
31
+
32
+ CLASSES = list(set(LABEL2ID.keys()))
33
+
34
+ # Cache location
35
+ DEFAULT_XDG_CACHE_HOME = "~/.cache"
36
+ XDG_CACHE_HOME = os.getenv("XDG_CACHE_HOME", DEFAULT_XDG_CACHE_HOME)
37
+ DEFAULT_HF_CACHE_HOME = os.path.join(XDG_CACHE_HOME, "huggingface")
38
+ HF_CACHE_HOME = os.path.expanduser(os.getenv("HF_HOME", DEFAULT_HF_CACHE_HOME))
39
+ DEFAULT_HF_DATASETS_CACHE = os.path.join(HF_CACHE_HOME, "datasets")
40
+ HF_DATASETS_CACHE = Path(os.getenv("HF_DATASETS_CACHE", DEFAULT_HF_DATASETS_CACHE))
41
+
42
+
43
+ class ARCA23KConfig(datasets.BuilderConfig):
44
+ """BuilderConfig for ARCA23K."""
45
+
46
+ def __init__(self, features, **kwargs):
47
+ super(ARCA23KConfig, self).__init__(version=datasets.Version(VERSION, ""), **kwargs)
48
+ self.features = features