{"id":15685412,"url":"https://github.com/hallerpatrick/pecc","last_synced_at":"2025-05-07T17:06:49.397Z","repository":{"id":229683846,"uuid":"764002279","full_name":"HallerPatrick/pecc","owner":"HallerPatrick","description":"[LREC-Coling 2024] PECC: Problem Extraction and Coding Challenges","archived":false,"fork":false,"pushed_at":"2024-05-30T09:29:08.000Z","size":8614,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T12:11:10.682Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HallerPatrick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-27T09:57:23.000Z","updated_at":"2024-12-30T10:39:48.000Z","dependencies_parsed_at":"2024-04-17T13:38:36.301Z","dependency_job_id":"eaf89e26-b348-4707-8a70-012f7ccc4aee","html_url":"https://github.com/HallerPatrick/pecc","commit_stats":null,"previous_names":["hallerpatrick/pecc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HallerPatrick%2Fpecc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HallerPatrick%2Fpecc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HallerPatrick%2Fpecc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HallerPatrick%2Fpecc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HallerPatrick","download_url":"https://codeload.github.com/HallerPatrick/pecc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249833634,"owners_count":21331843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T17:25:10.099Z","updated_at":"2025-04-20T00:31:24.485Z","avatar_url":"https://github.com/HallerPatrick.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 style=\"text-align: center\"\u003e PECC - Problem Extraction and Coding Challenges \u003c/h1\u003e\n\nComplementary repository for the paper **\"PECC: A Dataset for Problem Extraction and Coding Challenges\"** by Patrick Haller, Jonas Golde and Alan Akbik.\n\n\u003cp align=\"center\" style=\"font-style: italic\"\u003e\n    Our paper got accepted at LREC-Coling 2024! 🥳\n\u003c/p\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://huggingface.co/datasets/PatrickHaller/pecc\"\u003e 🤗 Dataset\u003c/a\u003e\n\u003c/br\u003e\n\u003ca href=\"https://huggingface.co/spaces/PatrickHaller/pecc-leaderboard\"\u003e🏅 Leaderboard\u003c/a\u003e\n\u003c/br\u003e\n\u003ca href=\"https://hallerpatrick.github.io/pecc/\"\u003e 📝 Blog Post\u003c/a\u003e\n\u003c/br\u003e\n\u003ca href=\"https://arxiv.org/abs/2404.18766\"\u003e📄 Paper\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n\n## Setup \n\nCreate a virtual environment and install the requirements.\n\n```bash\npython3 -m venv venv\nsource venv/bin/activate\npython -m pip install -r requirements.txt\n```\n\n\nDepending on the model in use, you will need to provide the respective API keys, e.g. for the OpenAI model. \n\n```bash\nexport OPENAI_API_KEY=\"your-api-key\"\n```\n\n## Usage \n\nThe evalation script provides several arguments to configure the evaluation. \n\n```txt\nusage: main.py [-h] [--model MODEL] [--subset SUBSET] [--story] [--venv-path VENV_PATH] [--output-file OUTPUT_FILE] [--instruct] [--kpass KPASS]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --model MODEL         Model to use ['gpt-3.5-turbo-16k', 'gpt-3.5-turbo-turbo', 'vertex_ai/chat-bison', 'vertex_ai/codechat-bison', 'vertex_ai/gemini-pro', 'vertex_ai/gemini-1.5-pro', 'WizardCoder-34B', 'mixtral', 'claude-3-opus', 'claude-3-sonnet', 'claude-3-haiku']\n  --subset SUBSET       Subset of the dataset to use (euler, aoc)\n  --story               Use the story subset of the dataset\n  --venv-path VENV_PATH\n                        Path to the venv\n  --output-file OUTPUT_FILE\n                        Path to output file\n  --instruct            Only run the instruction\n  --kpass KPASS         Number of passes to use\n```\n\n\u003e [!NOTE]\n\u003e The generated code will be executed by the python environment provide, while we didn't experience any issues, we cannot guarantee the safety of the code. \n\n\n## Download original AoC subset\n\nDue to licensing restrictions, we cannot provide the original data from the AoC dataset. However, you can download the original AoC dataset with a bash script we provide. \n\nFollowing requirements are needed:\n1. First, you need to have a registered account in the [AoC website](https://adventofcode.com/).\n2. You need to complete the AoC challenges from 2015 to 2022 to download the respective challenges\n3. You need to install the `aoc` CLI tool from [here](https://github.com/scarvalhojr/aoc-cli) and have th `jq` and `sponge` tool installed. \n4. Following the `aoc` [documentation](https://github.com/scarvalhojr/aoc-cli?tab=readme-ov-file#session-cookie-), a session token is needed which can be obtained from the AoC website after login. \n\n\n```bash\nexport ADVENT_OF_CODE_SESSION=\"your-session-token\"\nbash tools/download_puzzles.sh\n```\n\nPer default, the script will download the AoC challenges from 2015 to 2022 and merge it into \nthe `dataset/aoc_lite` directory. Refer to the script for more details.\n\n\n## Self-Hosting for Evaluation\n\nThe pipeline uses [LiteLLM](https://github.com/BerriAI/litellm) and [Langchain](https://github.com/langchain-ai/langchain) and the OpenAI Completions API.\nTo use a custom hostet model update the `model` map in `src/llm.py`. For self-hosting we used [vLLM](https://github.com/vllm-project/vllm).\n\n1. Run the model with vLLM:\n```\npython -m vllm.entrypoints.openai.api_server --model googel/gemma-7b-it\n# Running on http://0.0.0.0:8000\n```\n\n2. Setup client in `src/llm.py`\n\n```python\nreturn VLLMOpenAI(\n    openai_api_key=\"EMPTY\",\n    openai_api_base=\"http://0.0.0.0:8000/v1\",\n    model_name=model,\n    max_tokens=2048,\n)\n```\n\n\n## Reported Results\n\nAll results reported in the paper can be found in the `paper_results` folder. Which contains the\nraw output of the evaluation script for all models.\n\nTo produce a LaTeX table, run the following command:\n\n```bash\npython src.eval.py --results-folder paper_results\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhallerpatrick%2Fpecc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhallerpatrick%2Fpecc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhallerpatrick%2Fpecc/lists"}