Datasets:
updated data loader
Browse files- code_clippy_github.py +4 -4
code_clippy_github.py
CHANGED
|
@@ -145,7 +145,7 @@ class CodeClippyGithub(datasets.GeneratorBasedBuilder):
|
|
| 145 |
description=_DESCRIPTION,
|
| 146 |
features=datasets.Features({"code_text": datasets.Value("string"),
|
| 147 |
"repo_name": datasets.Value("string"),
|
| 148 |
-
"
|
| 149 |
"language": datasets.Value("string"),
|
| 150 |
"license": datasets.Value("string"),
|
| 151 |
"size": datasets.Value("int32")}),
|
|
@@ -197,10 +197,10 @@ class CodeClippyGithub(datasets.GeneratorBasedBuilder):
|
|
| 197 |
continue
|
| 198 |
if self.config.filter_licenses and not license in self.config.licenses:
|
| 199 |
continue
|
| 200 |
-
|
| 201 |
-
yield key, {"
|
| 202 |
"repo_name": j_dict['repo_name'],
|
| 203 |
-
"
|
| 204 |
"license": license,
|
| 205 |
"language": lang,
|
| 206 |
"size": int(j_dict['f0_'])}
|
|
|
|
| 145 |
description=_DESCRIPTION,
|
| 146 |
features=datasets.Features({"code_text": datasets.Value("string"),
|
| 147 |
"repo_name": datasets.Value("string"),
|
| 148 |
+
"file_path": datasets.Value("string"),
|
| 149 |
"language": datasets.Value("string"),
|
| 150 |
"license": datasets.Value("string"),
|
| 151 |
"size": datasets.Value("int32")}),
|
|
|
|
| 197 |
continue
|
| 198 |
if self.config.filter_licenses and not license in self.config.licenses:
|
| 199 |
continue
|
| 200 |
+
# TODO: Add more features like header comments, filename, and other features useful in a prompt.
|
| 201 |
+
yield key, {"code_text": j_dict['content'],
|
| 202 |
"repo_name": j_dict['repo_name'],
|
| 203 |
+
"file_path": j_dict['path'],
|
| 204 |
"license": license,
|
| 205 |
"language": lang,
|
| 206 |
"size": int(j_dict['f0_'])}
|