()
| 14 | return parser.parse_args() |
| 15 | |
| 16 | def main(): |
| 17 | args = get_args() |
| 18 | |
| 19 | subprocess.run(["sudo", "rm", "-rf", "data/repos"]) |
| 20 | subprocess.run(["sudo", "mkdir", "-p", "data/repos"]) |
| 21 | subprocess.run(["sudo", "chmod", "777", "data/repos"]) |
| 22 | |
| 23 | config = { |
| 24 | "name": "claude", |
| 25 | "nav": [{ |
| 26 | "model": "claude-3-haiku-20240307", |
| 27 | "api_key": os.environ.get("ANTHROPIC_API_KEY"), |
| 28 | "stop_sequences": ["\nObservation:"], |
| 29 | "base_url": "https://api.anthropic.com", |
| 30 | "api_type": "anthropic", |
| 31 | }], |
| 32 | "edit": [{ |
| 33 | "model": "claude-3-5-sonnet-20240620", |
| 34 | "api_key": os.environ.get("ANTHROPIC_API_KEY"), |
| 35 | "stop_sequences": ["\nObservation:"], |
| 36 | "price": [0.003, 0.015], |
| 37 | "base_url": "https://api.anthropic.com", |
| 38 | "api_type": "anthropic", |
| 39 | }], |
| 40 | "exec": [{ |
| 41 | "model": "claude-3-5-sonnet-20240620", |
| 42 | "api_type": os.environ.get("ANTHROPIC_API_KEY"), |
| 43 | "stop_sequences": ["\nObservation:"], |
| 44 | "price": [0.003, 0.015], |
| 45 | "base_url": "https://api.anthropic.com", |
| 46 | "api_type": "anthropic", |
| 47 | }], |
| 48 | "plan": [{ |
| 49 | "model": "claude-3-5-sonnet-20240620", |
| 50 | "api_type": os.environ.get("ANTHROPIC_API_KEY"), |
| 51 | "price": [0.003, 0.015], |
| 52 | "base_url": "https://api.anthropic.com", |
| 53 | "api_type": "anthropic", |
| 54 | }], |
| 55 | "type": "patch" |
| 56 | } |
| 57 | |
| 58 | task = SWEBench(logdir="results/swe_bench", split=args.split) |
| 59 | for idx in range(len(task)): |
| 60 | repo_link, commit, instance_id, image_name = task[idx] |
| 61 | success = False |
| 62 | retry = 0 |
| 63 | while success != True: |
| 64 | pilot = HyperAgent( |
| 65 | repo_path=repo_link, |
| 66 | commit=commit, |
| 67 | language="python", |
| 68 | clone_dir="data/repos", |
| 69 | llm_configs=config, |
| 70 | image_name=image_name, |
| 71 | verbose=1 |
| 72 | ) |
| 73 | try: |
no test coverage detected