Skip to content

Use LLMs to generate corpus #482 #958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion run_all_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,20 @@ def parse_args() -> argparse.Namespace:
'--agent',
action='store_true',
default=False,
help='Enables agent enhancement.')
help='Run experiment using the agent framework.')
parser.add_argument('-mr',
'--max-round',
type=int,
default=100,
help='Max trial round for agents.')
parser.add_argument(
'--generate-seeds', action='store_true', default=False,
help='Use LLM to generate a seed corpus creation script for each target.')
parser.add_argument(
'--seed-generation-mode',
choices=['script', 'direct'],
default='script',
help="Method for LLM seed generation: 'script' (generates python script) or 'direct' (generates file content).")

args = parser.parse_args()
if args.num_samples:
Expand Down Expand Up @@ -616,6 +624,14 @@ def main():
coverage_gain_dict = _process_total_coverage_gain()
_print_experiment_results(experiment_results, coverage_gain_dict)

# Set the environment variable if the flag is present
if args.generate_seeds:
os.environ['LLM_GENERATE_CORPUS'] = '1'
else:
# Ensure it's unset if the flag is not provided
if 'LLM_GENERATE_CORPUS' in os.environ:
del os.environ['LLM_GENERATE_CORPUS']


if __name__ == '__main__':
sys.exit(main())