sweagent.run.batch_instances.SimpleBatchInstance
Bases: BaseModel
A simple way to configure a single instance in a batch of instances that all use similar deployment configurations. We added traj_id to support multiple rollouts per instance.
Source code in SWE-agent/sweagent/run/batch_instances.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
base_commit
class-attribute
instance-attribute
base_commit = 'HEAD'
Used to reset repo.
ds
instance-attribute
ds
One item from the dataset.
extra_fields
class-attribute
instance-attribute
extra_fields = Field(default_factory=dict)
Any additional data to be added to the instance. This data will be available when formatting prompt templates.
instance_id
instance-attribute
instance_id
Unique identifier of the instance. Used for logging and environment naming.
repo_name
class-attribute
instance-attribute
repo_name = ''
Specifies the repository name to use.
For github repo_type, this is the git folder name.
For local repo_type, this is the local path to the repo.
For pre-existing repo_type, this is the name of the pre-existing repo.
repo_type
instance-attribute
repo_type
Type of the repository. Can be 'github', 'local', or '' (empty string for pre-existing).
traj_id
instance-attribute
traj_id
Unique identifier of the trajectory. Necessary when multiple rollouts are performed per instance.
from_swe_bench
classmethod
from_swe_bench(instance)
Convert instances from the classical SWE-bench dataset to the SimpleBatchInstance format.
| Attributes: |
|
|---|
Source code in SWE-agent/sweagent/run/batch_instances.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
to_full_batch_instance
to_full_batch_instance(deployment)
Merge the deployment options into the SimpleBatchInstance object to get a full BatchInstance.
We use our GithubRepoRetryConfig instead of GithubRepoConfig.
Source code in SWE-agent/sweagent/run/batch_instances.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | |
sweagent.run.batch_instances.SWEBenchInstances
Bases: BaseModel, AbstractInstanceSource
Load instances from SWE-bench.
Source code in SWE-agent/sweagent/run/batch_instances.py
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 | |
database
class-attribute
instance-attribute
database = '/home/zeta/ais_default_code_config_repo_507090/datasets'
Path to the local SWE-bench database.
end
class-attribute
instance-attribute
end = 500
End index of instances to load.
evaluate
class-attribute
instance-attribute
evaluate = False
Run sb-cli to evaluate
filter
class-attribute
instance-attribute
filter = '.*'
Regular expression to filter the instances by instance id.
model_patch_file
class-attribute
instance-attribute
model_patch_file = None
Path to a json file containing model patches for the instances. Used for MiniSandbox evaluation with patches.
repo_type
class-attribute
instance-attribute
repo_type = 'github'
Type of repository to use. Options include 'github', 'local', and 'preexisting'.
shuffle
class-attribute
instance-attribute
shuffle = False
Shuffle the instances (before filtering and slicing).
slice
class-attribute
instance-attribute
slice = ''
Select only a slice of the instances (after filtering by filter).
Possible values are stop or start:stop or start:stop:step.
(i.e., it behaves exactly like python's list slicing list[slice]).
start
class-attribute
instance-attribute
start = 0
Start index of instances to load.
subset
class-attribute
instance-attribute
subset = 'lite'
Subset of swe-bench to use
type
class-attribute
instance-attribute
type = 'swe_bench'
Discriminator for (de)serialization/CLI. Do not change.
get_instance_configs
get_instance_configs()
Load instances from SWE-bench dataset. This function is used for run_batch.py
Source code in SWE-agent/sweagent/run/batch_instances.py
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | |
sweagent.run.batch_instances.SWESmithInstances
Bases: BaseModel, AbstractInstanceSource
Load instances from SWE-smith.
Source code in SWE-agent/sweagent/run/batch_instances.py
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 | |
end
class-attribute
instance-attribute
end = 500
End index of instances to load.
filter
class-attribute
instance-attribute
filter = '.*'
Regular expression to filter the instances by instance id.
load_from_disk
class-attribute
instance-attribute
load_from_disk = False
Whether to load the dataset from local disk using load_from_disk.
num_rollouts_per_instance
class-attribute
instance-attribute
num_rollouts_per_instance = -1
Number of rollouts to perform per instance. If >1, the instances will be duplicated accordingly.
path
instance-attribute
path
Name or path of the dataset.
repo_type
class-attribute
instance-attribute
repo_type = 'github'
Type of the repository. Can be 'github', 'local', or anything else for pre-existing repositories. If the repo_type is 'github', we will use git fetch to get the code from the specified repo and base_commit in the instance config. If the repo_type is 'local', we do not support yet If the repo_type is anything else (e.g., 'preexisting'), we will assume that the code is already present in the deployment and do not perform any operations. The instance config should still specify the repo_name and base_commit for resetting the repo to the correct state.
shuffle
class-attribute
instance-attribute
shuffle = False
Shuffle the instances (before filtering and slicing).
slice
class-attribute
instance-attribute
slice = ''
Select only a slice of the instances (after filtering by filter).
Possible values are stop or start:stop or start:stop:step.
(i.e., it behaves exactly like python's list slicing list[slice]).
split
instance-attribute
split
Split of the dataset to load.
start
class-attribute
instance-attribute
start = 0
Start index of instances to load.
type
class-attribute
instance-attribute
type = 'swesmith'
Discriminator for (de)serialization/CLI. Do not change.
get_instance_configs
get_instance_configs()
Load instances from SWE-smith dataset. This function is used for run_batch.py It duplicates instances if num_rollouts_per_instance>1.
Source code in SWE-agent/sweagent/run/batch_instances.py
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 | |
sweagent.run.batch_instances.SkyRLInstances
Bases: BaseModel, AbstractInstanceSource
Load instances from RL data (smith format).
Source code in SWE-agent/sweagent/run/batch_instances.py
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 | |
filter
class-attribute
instance-attribute
filter = '.*'
Regular expression to filter the instances by instance id.
path
instance-attribute
path
Name or path of the dataset.
repo_type
class-attribute
instance-attribute
repo_type = 'github'
Type of the repository. Can be 'github', 'local', or '' (empty string for pre-existing).
shuffle
class-attribute
instance-attribute
shuffle = False
Shuffle the instances (before filtering and slicing).
slice
class-attribute
instance-attribute
slice = ''
Select only a slice of the instances (after filtering by filter).
Possible values are stop or start:stop or start:stop:step.
(i.e., it behaves exactly like python's list slicing list[slice]).
split
instance-attribute
split
Split of the dataset to load.
type
class-attribute
instance-attribute
type = 'skyrl'
Discriminator for (de)serialization/CLI. Do not change.
get_instance_configs_ds
get_instance_configs_ds(dataset)
Load instances from RL data (smith format). This function is used for SkyRL
Source code in SWE-agent/sweagent/run/batch_instances.py
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 | |