Datasets:

Modalities:
Text
ArXiv:
Tags:
code
Libraries:
Datasets
License:
tianyang commited on
Commit
c76e6d7
1 Parent(s): 5b9f5fd

do not seperate file

Browse files
Files changed (2) hide show
  1. repobench-c.py +17 -1
  2. utils.py +0 -16
repobench-c.py CHANGED
@@ -18,7 +18,6 @@ import gzip
18
  import pickle
19
  import textwrap
20
  import datasets
21
- from utils import construct_prompt
22
 
23
  _CITATION = """\
24
  @misc{liu2023repobench,
@@ -51,6 +50,23 @@ _URLs = {
51
  "java_if": "https://raw.githubusercontent.com/Leolty/repobench/main/data/code_completion/java/in_file.gz"
52
  }
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  class RepoBenchR(datasets.GeneratorBasedBuilder):
55
  """RepoBench"""
56
 
 
18
  import pickle
19
  import textwrap
20
  import datasets
 
21
 
22
  _CITATION = """\
23
  @misc{liu2023repobench,
 
50
  "java_if": "https://raw.githubusercontent.com/Leolty/repobench/main/data/code_completion/java/in_file.gz"
51
  }
52
 
53
+
54
+ def construct_prompt(data_point:dict, language:str):
55
+
56
+ if language == "python":
57
+ path = f"# Path: {data_point['file_path']}"
58
+
59
+ elif language == "java":
60
+ path = f"// Path: {data_point['file_path']}"
61
+
62
+ prompt = f"""{data_point['context']}
63
+ {path}
64
+ {data_point['import_statement']}
65
+
66
+ {data_point['code']}"""
67
+
68
+ return prompt
69
+
70
  class RepoBenchR(datasets.GeneratorBasedBuilder):
71
  """RepoBench"""
72
 
utils.py DELETED
@@ -1,16 +0,0 @@
1
-
2
- def construct_prompt(data_point:dict, language:str):
3
-
4
- if language == "python":
5
- path = f"# Path: {data_point['file_path']}"
6
-
7
- elif language == "java":
8
- path = f"// Path: {data_point['file_path']}"
9
-
10
- prompt = f"""{data_point['context']}
11
- {path}
12
- {data_point['import_statement']}
13
-
14
- {data_point['code']}"""
15
-
16
- return prompt