Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- dataset/dataset.json +0 -12
- openenv.yaml +1 -30
- server/code_review_environment.py +1 -1
dataset/dataset.json
CHANGED
|
@@ -1,7 +1,5 @@
|
|
| 1 |
[
|
| 2 |
{
|
| 3 |
-
"id": "task_1",
|
| 4 |
-
"grader": "code_review_grader",
|
| 5 |
"task_type": "easy",
|
| 6 |
"pr": {
|
| 7 |
"id": "2",
|
|
@@ -22,8 +20,6 @@
|
|
| 22 |
}
|
| 23 |
},
|
| 24 |
{
|
| 25 |
-
"id": "task_2",
|
| 26 |
-
"grader": "code_review_grader",
|
| 27 |
"task_type": "medium",
|
| 28 |
"pr": {
|
| 29 |
"id": "3",
|
|
@@ -44,8 +40,6 @@
|
|
| 44 |
}
|
| 45 |
},
|
| 46 |
{
|
| 47 |
-
"id": "task_3",
|
| 48 |
-
"grader": "code_review_grader",
|
| 49 |
"task_type": "medium",
|
| 50 |
"pr": {
|
| 51 |
"id": "4",
|
|
@@ -66,8 +60,6 @@
|
|
| 66 |
}
|
| 67 |
},
|
| 68 |
{
|
| 69 |
-
"id": "task_4",
|
| 70 |
-
"grader": "code_review_grader",
|
| 71 |
"task_type": "hard",
|
| 72 |
"pr": {
|
| 73 |
"id": "6",
|
|
@@ -88,8 +80,6 @@
|
|
| 88 |
}
|
| 89 |
},
|
| 90 |
{
|
| 91 |
-
"id": "task_5",
|
| 92 |
-
"grader": "code_review_grader",
|
| 93 |
"task_type": "hard",
|
| 94 |
"pr": {
|
| 95 |
"id": "7",
|
|
@@ -110,8 +100,6 @@
|
|
| 110 |
}
|
| 111 |
},
|
| 112 |
{
|
| 113 |
-
"id": "task_6",
|
| 114 |
-
"grader": "code_review_grader",
|
| 115 |
"task_type": "hard",
|
| 116 |
"pr": {
|
| 117 |
"id": "8",
|
|
|
|
| 1 |
[
|
| 2 |
{
|
|
|
|
|
|
|
| 3 |
"task_type": "easy",
|
| 4 |
"pr": {
|
| 5 |
"id": "2",
|
|
|
|
| 20 |
}
|
| 21 |
},
|
| 22 |
{
|
|
|
|
|
|
|
| 23 |
"task_type": "medium",
|
| 24 |
"pr": {
|
| 25 |
"id": "3",
|
|
|
|
| 40 |
}
|
| 41 |
},
|
| 42 |
{
|
|
|
|
|
|
|
| 43 |
"task_type": "medium",
|
| 44 |
"pr": {
|
| 45 |
"id": "4",
|
|
|
|
| 60 |
}
|
| 61 |
},
|
| 62 |
{
|
|
|
|
|
|
|
| 63 |
"task_type": "hard",
|
| 64 |
"pr": {
|
| 65 |
"id": "6",
|
|
|
|
| 80 |
}
|
| 81 |
},
|
| 82 |
{
|
|
|
|
|
|
|
| 83 |
"task_type": "hard",
|
| 84 |
"pr": {
|
| 85 |
"id": "7",
|
|
|
|
| 100 |
}
|
| 101 |
},
|
| 102 |
{
|
|
|
|
|
|
|
| 103 |
"task_type": "hard",
|
| 104 |
"pr": {
|
| 105 |
"id": "8",
|
openenv.yaml
CHANGED
|
@@ -3,33 +3,4 @@ name: code_review
|
|
| 3 |
type: space
|
| 4 |
runtime: fastapi
|
| 5 |
app: server.app:app
|
| 6 |
-
port: 8000
|
| 7 |
-
tasks:
|
| 8 |
-
- id: task_1
|
| 9 |
-
description: "Easy — missing import detection"
|
| 10 |
-
max_steps: 3
|
| 11 |
-
grader: graders:CodeReviewGrader
|
| 12 |
-
- id: task_2
|
| 13 |
-
description: "Medium — division by zero handling"
|
| 14 |
-
max_steps: 3
|
| 15 |
-
grader: graders:CodeReviewGrader
|
| 16 |
-
- id: task_3
|
| 17 |
-
description: "Medium — inefficient loop optimization"
|
| 18 |
-
max_steps: 3
|
| 19 |
-
grader: graders:CodeReviewGrader
|
| 20 |
-
- id: task_4
|
| 21 |
-
description: "Hard — hardcoded password security vulnerability"
|
| 22 |
-
max_steps: 3
|
| 23 |
-
grader: graders:CodeReviewGrader
|
| 24 |
-
- id: task_5
|
| 25 |
-
description: "Hard — SQL injection vulnerability"
|
| 26 |
-
max_steps: 3
|
| 27 |
-
grader: graders:CodeReviewGrader
|
| 28 |
-
- id: task_6
|
| 29 |
-
description: "Hard — cross-file null handling bug"
|
| 30 |
-
max_steps: 3
|
| 31 |
-
grader: graders:CodeReviewGrader
|
| 32 |
-
endpoints:
|
| 33 |
-
reset: /reset
|
| 34 |
-
step: /step
|
| 35 |
-
health: /health
|
|
|
|
| 3 |
type: space
|
| 4 |
runtime: fastapi
|
| 5 |
app: server.app:app
|
| 6 |
+
port: 8000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
server/code_review_environment.py
CHANGED
|
@@ -89,7 +89,7 @@ class CodeReviewEnvironment(Environment):
|
|
| 89 |
"""Initialize the code_review environment."""
|
| 90 |
self._state = State(episode_id=str(uuid4()), step_count=0)
|
| 91 |
self._reset_count = 0
|
| 92 |
-
self.max_steps =
|
| 93 |
self.task_index = 0
|
| 94 |
with open(dataset_path) as f:
|
| 95 |
self.dataset = json.load(f)
|
|
|
|
| 89 |
"""Initialize the code_review environment."""
|
| 90 |
self._state = State(episode_id=str(uuid4()), step_count=0)
|
| 91 |
self._reset_count = 0
|
| 92 |
+
self.max_steps = 5
|
| 93 |
self.task_index = 0
|
| 94 |
with open(dataset_path) as f:
|
| 95 |
self.dataset = json.load(f)
|