Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Remove scripts dir (#908)

Kilian Lieret80cb30f3ba4a
diff --git a/scripts/README.md b/scripts/README.md
deleted file mode 100644
index bca0381f..00000000
--- a/scripts/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-# Scripts
-
-This README contains documentation for the main inference script `run.sh` along with some miscellaneous scripts that may be helpful.
-
-> [!WARNING]
-> These scripts have been written to be invoked from the root of this codebase (i.e. `./scripts/run.sh`).
-
-## πŸƒ Inference Script
-The `./run.sh` script has been provided as an example of how to invoke `run.py`.
-
-A single `run.py` call will generate a `trajectory/<username>/<experiment name>` folder containing the trajectories and predictions generated by a `<model_name>` model run on every instance in the `<data_path>` dataset.
-
-The following is a comprehensive guide to using the provided `run.py` script, detailing available command-line arguments, their purposes, and default values. Flags that you might find helpful have been marked with a πŸ’‘.
-
-The code and explanation of the implementations for *configuration based workflows* are explained in [`agent/`](../sweagent/agent/README.md).
-
-> [!TIP]
-> Run `python run.py --help` to view the most up-to-date documentation of the arguments.
-
-#### Optional Arguments
-* `-h, --help`: Show the help message and exit.
-
-#### Script Arguments
-These arguments configure the script's behavior:
-* `--instance_filter <str>` πŸ’‘: Run instances that match this regex pattern. Default is .*.
-* `--noskip_existing, --skip_existing,`: [Do not] skip instances that have been completed before.
-* `--suffix <str>`: Appends a suffix to the name of the folder containing the trajectories for an experiment run.
-
-#### Environment Arguments
-These arguments are related to the environment configuration:
-* `--data_path <str>` πŸ’‘: Path to the data file -or- a Hugging Face dataset -or- a GitHub issue URL.
-* `--base_commit <str>`: You can specify the base commit sha to checkout. This is determined automatically for instances in SWE-bench.
-* `--image_name <str>`: Name of the Docker image to use. Default is swe-agent.
-* `--noinstall_environment, --install_environment`: [Do not] install the environment. Default is True.
-* `--noverbose, --verbose`: Enable verbose output. Default is False.
-* `--timeout <int>`: Timeout in seconds. Default is 35.
-* `--container_name <str>` πŸ’‘: Name of the Docker container if you would like to create a persistent container. Optional.
-
-> [!WARNING]
-> If you specify a container name, do not run multiple instances of `run.py` with the same container name!
-
-#### AgentArguments
-Configure agent behavior:
-* `--config_file <Path>` πŸ’‘: Path to the configuration YAML file. Default is config/default.yaml.
-
-#### ModelArguments
-Configure model parameters:
-* `--model_name <str>` πŸ’‘: Name of the model. Default is `gpt4`.
-* `--per_instance_cost_limit <float>` πŸ’‘: Per-instance cost limit (interactive loop will automatically terminate when cost limit is hit). Default is 3.0.
-* `--temperature <float>` πŸ’‘: Model temperature. Default is 0.0.
-* `--top_p <float>` πŸ’‘: Top p filtering. Default is 0.95.
-* `--total_cost_limit <float>`: Total cost limit. Default is 0.0 (unlimited).
-
-### πŸ“™ Example Usage
-Run with custom data path and verbose mode:
-```bash
-python run.py --data_path /path/to/data.json --verbose
-```
-
-Specify a model and adjust the temperature and top_p parameters:
-```bash
-python run.py --model_name gpt4 --temperature 0.2 --top_p 0.9
-```
-
-## πŸ› οΈ Miscellaneous Scripts
-- `remove_all_containers.sh`: Forcibly removes all Docker containers currently present on the system.
-- `run_and_eval.sh`: Runs SWE-agent inference and evaluation on a specified dataset N times. You can specify the `dataset_path`, `num_runs`, `template`, and `suffix` arguments.
-- `run_jsonl.sh`: Run SWE-agent inference from a `.jsonl` file that contains a SWE-bench style task instance.
-- `run_replay.sh`: Run SWE-agent inference from a `.traj` file. This is useful for automatically creating a new demonstration for a new config from an existing sequence of actions.
diff --git a/scripts/remove_all_containers.sh b/scripts/remove_all_containers.sh
deleted file mode 100755
index fdb5793b..00000000
--- a/scripts/remove_all_containers.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-# Remove all docker containers
-
-docker rm -f $(docker ps -aq)
diff --git a/scripts/run.sh b/scripts/run.sh
deleted file mode 100755
index 3f64dedc..00000000
--- a/scripts/run.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-python run.py \
- --model_name human \
- --data_path ./data/dev-easy/swe-bench-dev-easy.json \
- --per_instance_cost_limit 3.00 \
- --config_file ./config/default.yaml
diff --git a/scripts/run_from_url.sh b/scripts/run_from_url.sh
deleted file mode 100755
index b24a8c18..00000000
--- a/scripts/run_from_url.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-python run.py \
- --model_name human \
- --data_path https://github.com/psf/requests/issues/6254 \
- --base_commit ac3be98b19f4d09c6a970b271a3ae30f3d0858f7 \
- --per_instance_cost_limit 3.00 \
- --config_file ./config/default_from_url.yaml
diff --git a/scripts/run_jsonl.sh b/scripts/run_jsonl.sh
deleted file mode 100755
index 776cbfe6..00000000
--- a/scripts/run_jsonl.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-
-# Check if an argument was provided
-if [ "$#" -ne 1 ]; then
- echo "Usage: $0 <path_to_jsonl_file>"
- exit 1
-fi
-
-FILE="$1"
-
-# Check if the file exists and is readable
-if [ ! -f "$FILE" ] || [ ! -r "$FILE" ]; then
- echo "Error: File '$FILE' does not exist or is not readable."
- exit 2
-fi
-
-# Iterate over each line of the JSONL file
-while IFS= read -r line; do
- # Construct command arguments from the JSON map
- # jq -r '. | to_entries | .[] | "--\(.key) \(.value)"' converts each key-value pair in the JSON object
- # into a format suitable for passing to the Python script
- # xargs -n 2 groups them back into pairs to handle as arguments correctly
- ARGS=$(echo "$line" | jq -r '. | to_entries | .[] | "--\(.key) \(.value)"' | xargs -n 2 echo)
-
- # Execute the Python script with the constructed arguments
- echo $ARGS
- python run.py $ARGS
-done < "$FILE"
diff --git a/scripts/run_replay.sh b/scripts/run_replay.sh
deleted file mode 100755
index 2bc878ac..00000000
--- a/scripts/run_replay.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-python run_replay.py \
- --traj_path ./trajectories/johnbyang/-demonstrations/pvlib__pvlib-python-1216.default_test.traj \
- --data_path ./trajectories/johnbyang/-demonstrations/pvlib__pvlib-python-1216.json \
- --config_file config/e2e/default_test.yaml
\ No newline at end of file