acul3 commited on
Commit
e579e12
1 Parent(s): c44afbe

fix loader

Browse files
Files changed (1) hide show
  1. KoPI-NLLB.py +5 -5
KoPI-NLLB.py CHANGED
@@ -35,7 +35,7 @@ for j in _CONF_LANG:
35
  _ALL_CONFIG = ["all-raw", "all-dedup", "all-neardup"] + _CONFIGS
36
  _HOMEPAGE = "https://huggingface.co/datasets/munggok/KoPI-NLLB"
37
  _LICENSE = "ODC_C"
38
- _BASE_URL = "https://huggingface.co/datasets/munggok/KoPI-NLLB/resolve/main/{tipe}/{lang}.json.zst",
39
 
40
  def kopi_nllb_constructor(nam):
41
  return KoPINLLBConfig(
@@ -62,8 +62,8 @@ class KoPINLLB(datasets.GeneratorBasedBuilder):
62
  {
63
  "text": datasets.Value("string"),
64
  "url": datasets.Value("string"),
65
- "score": datasets.Value("string"),
66
- "source": datasets.Value("float32"),
67
  }
68
  ),
69
  supervised_keys=None,
@@ -74,9 +74,9 @@ class KoPINLLB(datasets.GeneratorBasedBuilder):
74
  def _split_generators(self, dl_manager):
75
  name = self.config.name.split("-")
76
  if name[0] == "all":
77
- train = [_BASE_URL.format(tipe=split[0],lang=m) for m in _CONF_LANG]
78
  else:
79
- train = [_BASE_URL.format(tipe=split[0],lang=split[1])]
80
  train_downloaded_files = dl_manager.download(train)
81
  return [
82
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepaths": train_downloaded_files})
 
35
  _ALL_CONFIG = ["all-raw", "all-dedup", "all-neardup"] + _CONFIGS
36
  _HOMEPAGE = "https://huggingface.co/datasets/munggok/KoPI-NLLB"
37
  _LICENSE = "ODC_C"
38
+ _BASE_URL = 'https://huggingface.co/datasets/munggok/KoPI-NLLB/resolve/main/{tipe}/{lang}.json.zst'
39
 
40
  def kopi_nllb_constructor(nam):
41
  return KoPINLLBConfig(
 
62
  {
63
  "text": datasets.Value("string"),
64
  "url": datasets.Value("string"),
65
+ "score": datasets.Value("float32"),
66
+ "source": datasets.Value("string"),
67
  }
68
  ),
69
  supervised_keys=None,
 
74
  def _split_generators(self, dl_manager):
75
  name = self.config.name.split("-")
76
  if name[0] == "all":
77
+ train = [_BASE_URL.format(tipe=name[1],lang=m) for m in _CONF_LANG]
78
  else:
79
+ train = [_BASE_URL.format(tipe=name[1],lang=name[0])]
80
  train_downloaded_files = dl_manager.download(train)
81
  return [
82
  datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepaths": train_downloaded_files})