Skip to content

Commit c3c6621

Browse files
committed
Rename and refactor
1 parent c9f48fd commit c3c6621

File tree

8 files changed

+22
-20
lines changed

8 files changed

+22
-20
lines changed

README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,34 @@ pip install requirements.txt
1111
## Evaluation Pipeline Configuration
1212

1313
We use [Hydra](https://hydra.cc/docs/intro/) library for evaluation pipeline.
14-
Each configuration is specified in `config.yaml` format:
14+
Each configuration is specified in `eval.yaml` format:
1515

1616
```yaml
1717
# @package _global_
1818
hydra:
1919
job:
20-
name: planning_${agent.model_name}
20+
name: ${agent.name}_${agent.model_name}_[YOUR_ADDITIONAL_TOKEN_OR_NOTHING]
2121
run:
2222
dir:[YOUR_PATH_TO_OUTPUT_DIR]/${hydra:job.name}
2323
job_logging:
2424
root:
25-
handlers: [ console, file ]
25+
handlers: [console, file]
2626
defaults:
2727
- _self_
2828
- data_source: hf
29-
- env: http
29+
- env: code_engine
3030
- agent: planning
3131
```
3232
3333
Where you can define the datasource, env and agent you want to evaluate.
3434
We present several implementations for each defined in sub yamls:\
3535
36-
| field | options |
37-
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
38-
| `data_source` | [hf.yaml](configs/template_generation/data_source/hf.yaml) |
39-
| `env` | [http.yaml](configs/template_generation/env/http.yaml) |
40-
| `agent` | [vanilla.yaml](configs/template_generation/agent/vanilla.yaml)<br> [planning.yaml](configs/template_generation/agent/planning.yaml) <br> [reflexion.yaml](configs/template_generation/agent/reflexion.yaml)<br> [tree_of_thoughts.yaml](configs/template_generation/agent/tree_of_thoughts.yaml) <br> [adapt.yaml](configs/template_generation/agent/adapt.yaml) |
36+
| field | options |
37+
|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
38+
| `data_source` | [hf.yaml](configs/template_generation/data_source/hf.yaml) |
39+
| `env` | [code_engine.yaml](configs/template_generation/env/code_engine.yaml) <br> [http.yaml](configs/template_generation/env/http.yaml) <br> [few_shot.yaml](configs/template_generation/env/few_shot.yaml) |
40+
| `agent` | [few_shot.yaml](configs/template_generation/agent/few_shot.yaml) <br> [planning.yaml](configs/template_generation/agent/planning.yaml) <br> [vanilla.yaml](configs/template_generation/agent/vanilla.yaml) <br> [reflexion.yaml](configs/template_generation/agent/reflexion.yaml) <br> [tree_of_thoughts.yaml](configs/template_generation/agent/tree_of_thoughts.yaml) <br> [adapt.yaml](configs/template_generation/agent/adapt.yaml) |
41+
4142

4243
# Project Template Generation Evaluation
4344

File renamed without changes.

src/template_generation/dataset_collection/__init__.py

Whitespace-only changes.

src/template_generation/add_data_metrics.py src/template_generation/dataset_collection/add_data_metrics.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def calc_stats(config: DictConfig):
148148
df.to_csv(os.path.join(config.data_path, f'{category}_template_repos.csv'), index=False)
149149

150150

151-
@hydra.main(config_path="../../configs/template_generation", config_name="data", version_base=None)
151+
@hydra.main(config_path="../../../configs/template_generation", config_name="data", version_base=None)
152152
def main(config: DictConfig):
153153
calc_stats(config)
154154

src/template_generation/run_git_data_collection.py src/template_generation/dataset_collection/run_git_data_collection.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from src.utils.github.github_utils import clone_repo
1818
from src.utils.hf_utils import CATEGORIES, FEATURES, HUGGINGFACE_REPO
1919
from src.utils.jsonl_utils import read_jsonl
20-
from src.template_generation.prompts import get_gpt_description_system_prompt
2120

2221
logging.basicConfig(
2322
format='%(asctime)s %(message)s',
@@ -49,6 +48,14 @@
4948
'BSD 2-Clause "Simplified" License']
5049

5150

51+
def get_gpt_description_system_prompt() -> str:
52+
return """Rewrite in 1-2 small sentences maximum template description and README heading asif user wants to generate template code using GPT.\n
53+
Input:\n
54+
This scaffold project is written in Kotlin and will serve an example of implementing a Selenium test project with FluentLenium (Selenium3) and Gradle (with kotlin DSL). Everything is set up and tests can be added straight away. Used Testrunner is JUnit 5. Since Kotlin has an excellent Java interop it's perfectly fine to write your Tests in Java if you want, it will work out of the box. To execute the tests just browse to the path where the selenium-kotlin-example is located via terminal and type ./gradlew clean test or execute the tests in your IDE. The Project will use Chrome Browser in Headless mode by default / if no other browser is stated (see list of implemented browsers for more info on how to use them).\n
55+
Output:\n
56+
Kotlin template with gradle.kts and Selenium tests with FluentLenium and testrunner is JUnit 5"""
57+
58+
5259
def load_repos_data(config: DictConfig):
5360
for category in ['py']:
5461
with open(os.path.join(config.data_path, f"{category}_search.json"), "r", errors='ignore') as f:
@@ -222,7 +229,7 @@ def add_gpt_description(project, test_full_names: list[str]):
222229
df.to_csv(os.path.join(config.data_path, f"{category}_template_repos.csv"), index=False)
223230

224231

225-
@hydra.main(config_path="../../configs/template_generation", config_name="data", version_base=None)
232+
@hydra.main(config_path="../../../configs/template_generation", config_name="data", version_base=None)
226233
def main(config: DictConfig):
227234
load_dotenv()
228235
# load_repos_data(config)

src/template_generation/run_ide_data_collection.py src/template_generation/dataset_collection/run_ide_data_collection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def upload_projects(config: DictConfig):
7171
)
7272

7373

74-
@hydra.main(config_path="../../configs/template_generation", config_name="data", version_base=None)
74+
@hydra.main(config_path="../../../configs/template_generation", config_name="data", version_base=None)
7575
def main(config: DictConfig):
7676
load_dotenv()
7777
upload_projects(config)

src/template_generation/prompts.py

-6
This file was deleted.

src/template_generation/run_eval.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async def run_template_generation(agent: BaseAgent, env: BaseEnv, data_source: B
9898
writer.writerow(results_dict.values())
9999

100100

101-
@hydra.main(config_path="../../configs/template_generation", config_name="config.yaml", version_base="1.2")
101+
@hydra.main(config_path="../../configs/template_generation", config_name="eval.yaml", version_base="1.2")
102102
def main(cfg: EvalConfig) -> None:
103103
agent: BaseAgent = hydra.utils.instantiate(cfg.agent)
104104
env: BaseEnv = hydra.utils.instantiate(cfg.env)

0 commit comments

Comments
 (0)