Make AbstentionBench pip-installable#13
Open
jeqcho wants to merge 6 commits intofacebookresearch:mainfrom
Open
Make AbstentionBench pip-installable#13jeqcho wants to merge 6 commits intofacebookresearch:mainfrom
jeqcho wants to merge 6 commits intofacebookresearch:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12
Transform AbstentionBench into a Pip-Installable Python Package
Summary
Transform AbstentionBench into a pip-installable Python package by reorganizing the code structure, adding proper packaging configuration, and updating import paths throughout the codebase.
Background
AbstentionBench was previously structured as a standalone project without proper Python package organization. This transformation enables the project to be installed as a dependency via pip, making it easier to integrate into other projects and evaluation frameworks like Inspect Evals.
Changes Made
Package Structure Reorganization
abstentionbench/with proper__init__.pyfilesrecipe/→abstentionbench/recipe/configs/→abstentionbench/configs/analysis/→abstentionbench/analysis/data/→abstentionbench/data/__init__.pyfiles for all modules to make them proper Python packagesModern Packaging Configuration
pyproject.tomlwith:abstention-bench = "main:main"Import System Updates
Updated main.py imports:
recipe.abstention→abstentionbench.recipe.abstentionrecipe.inference→abstentionbench.recipe.inferencerecipe.models→abstentionbench.recipe.modelsUpdated all Python test files to use new import paths:
tests/run_llama3_instruct_inference.pytests/test_abstention_detector.pytests/test_correctness_evaluator.pytests/test_datasets.pytests/test_inference.pytests/test_job_manager.pytests/test_models.pyYAML Configuration Files Update
Updated all 23 dataset configuration files in
/abstentionbench/configs/dataset/to use correct import paths:Before:
After:
Files updated:
alcuna.yaml,bbq.yaml,big_bench_disambiguate.yaml,big_bench_known_unknowns.yamlcoconot.yaml,dummy.yaml,falseqa.yaml,freshqa.yamlgpqa.yaml,gsm8k.yaml,kuq.yaml,mediq.yamlmmlu_history.yaml,mmlu_math.yaml,moralchoice.yaml,musique.yamlqaqa.yaml,qasper.yaml,self_aware.yaml,situated_qa.yamlsquad2.yaml,umwp.yaml,worldsense.yamlGit Configuration
.gitignoreto include Python package-specific patterns and build artifactsInstallation Options
Usage
Testing Completed
pip install -e .succeeds)python pytest)Backward Compatibility
This transformation enables AbstentionBench to be used as a standard Python package while maintaining full backward compatibility with existing workflows.