This project is a reinforcement learning based code contest system. The goal is to design a system that can automatically generate code for a given problem and evaluate the performance of the generated code. The system will be implemented with Python.
The project is organized into several folders:
code: Contains code files generated for model evaluation (for future use).config: Contains configuration files for the model (for future use).data: Contains the data generated byprocess.pyfor training and testing the model.raw_data: Contains the raw data.results: Contains the results for platform submission.scripts: Contains utility functions used for data preprocessing, model training, and evaluation.tmp: Contains temporary cpp/exe files (cleaned up after evaluation).
To use the project, you need to install the required packages and run the following commands:
-
Install the required packages:
pip install -r requirements.txt
-
Preprocess the raw data (only when data folder is empty or needs modification):
Put your raw data in the
raw_datafolder.---raw_data |--- 1_ShellGame | |--- data | | |--- 1.in | | |--- 1.out | | |--- ... | |--- 题面.md | |--- 2_SleepCowHerding | |--- data | | |--- 1.in | | |--- 1.out | | |--- ... | |--- 题面.md | ...Then run:
python scripts/process_data.py
This will generate the data in the
datafolder. -
Generate code:
python scripts/llm_coder.py --model_name "glm" -
Run code:
Utilize
scripts/run_code.pyto run the generated code. -
Submit and evaluate code:
python scripts/frontend.py <Competition ID>
The competition ID can be found on the platform.
Note: This API provide by the organizers is unbelivably slow.