Update loading script
Browse files
code_x_glue_cc_code_completion_token.py
CHANGED
|
@@ -96,7 +96,7 @@ class CodeXGlueCcCodeCompletionTokenPythonImpl(CodeXGlueCcCodeCompletionTokenImp
|
|
| 96 |
if language != "python":
|
| 97 |
raise RuntimeError(f"Unknown language {language}")
|
| 98 |
|
| 99 |
-
yield "data", "
|
| 100 |
|
| 101 |
def process_string(self, token):
|
| 102 |
# Copyright (c) Microsoft Corporation.
|
|
@@ -183,16 +183,6 @@ class CodeXGlueCcCodeCompletionTokenPythonImpl(CodeXGlueCcCodeCompletionTokenImp
|
|
| 183 |
base_dir = file_paths["data"]
|
| 184 |
filename = self.PYTHON_FILE_MAPPING[split_name]
|
| 185 |
|
| 186 |
-
data_dir = os.path.join(base_dir, "data")
|
| 187 |
-
if not os.path.exists(data_dir):
|
| 188 |
-
import gzip
|
| 189 |
-
import tarfile
|
| 190 |
-
|
| 191 |
-
gzip_filename = os.path.join(base_dir, "data.tar.gz")
|
| 192 |
-
with gzip.open(gzip_filename, "rb") as gzip_file:
|
| 193 |
-
t = tarfile.TarFile(fileobj=gzip_file)
|
| 194 |
-
t.extractall(path=base_dir)
|
| 195 |
-
|
| 196 |
idx = 0
|
| 197 |
for entry in self.py_tokenize(base_dir=base_dir, file_name=filename):
|
| 198 |
path, out_tokens = entry
|
|
|
|
| 96 |
if language != "python":
|
| 97 |
raise RuntimeError(f"Unknown language {language}")
|
| 98 |
|
| 99 |
+
yield "data", "https://huggingface.co/datasets/code_x_glue_cc_code_completion_token/resolve/main/data/python/py150_files.zip"
|
| 100 |
|
| 101 |
def process_string(self, token):
|
| 102 |
# Copyright (c) Microsoft Corporation.
|
|
|
|
| 183 |
base_dir = file_paths["data"]
|
| 184 |
filename = self.PYTHON_FILE_MAPPING[split_name]
|
| 185 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 186 |
idx = 0
|
| 187 |
for entry in self.py_tokenize(base_dir=base_dir, file_name=filename):
|
| 188 |
path, out_tokens = entry
|