Skip to content
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

[WIP, Agent] Extension editing experiments: removing edit_file_by_line #2846

Closed
wants to merge 54 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
d3a2d10
add replace-based block edit & preliminary test case fix
xingyaoww Jun 28, 2024
b03fd2c
further fix the insert behavior
xingyaoww Jun 28, 2024
3700478
make edit only work on first occurence
xingyaoww Jun 28, 2024
8138371
bump codeact version since we now use new edit agentskills
xingyaoww Jun 28, 2024
45283e1
update prompt for new agentskills
xingyaoww Jun 28, 2024
790b94f
update integration tests
xingyaoww Jun 28, 2024
8e630c5
make run_infer.sh executable
xingyaoww Jun 28, 2024
693a53f
remove code block for edit_file
xingyaoww Jun 28, 2024
7fcba43
update integration test for prompt changes
xingyaoww Jun 28, 2024
22de134
default to not use hint for eval
xingyaoww Jun 29, 2024
4ec06f0
fix insert emptyfile bug
xingyaoww Jun 29, 2024
2c85f43
throw value error when `to_replace` is empty
xingyaoww Jun 29, 2024
621a158
make `_edit_or_insert_file` return string so we can try to fix some l…
xingyaoww Jun 29, 2024
4cb8bdb
add todo
xingyaoww Jun 29, 2024
20cdd32
update integration test
xingyaoww Jun 29, 2024
db14924
fix sandbox test for this PR
xingyaoww Jul 1, 2024
00f57e9
fix inserting with additional newline
xingyaoww Jul 1, 2024
a2f0916
rename to edit_file_by_replace
xingyaoww Jul 1, 2024
cbf2298
add back `edit_file_by_line`
xingyaoww Jul 1, 2024
fb0b9de
update prompt for new editing tool
xingyaoww Jul 1, 2024
cf9eef9
fix integration tests
xingyaoww Jul 1, 2024
a251122
bump codeact version since there are more changes
xingyaoww Jul 1, 2024
0aa476c
add back append file
xingyaoww Jul 1, 2024
ab47585
fix current line for append
xingyaoww Jul 1, 2024
eba37d5
fix append unit tests
xingyaoww Jul 1, 2024
22274be
change the location where we show edited line no to agent and fix tests
xingyaoww Jul 1, 2024
a45953d
update integration tests
xingyaoww Jul 2, 2024
f85c847
fix global window size affect by open_file bug
xingyaoww Jul 2, 2024
62480e5
fix global window size affect by open_file bug
xingyaoww Jul 2, 2024
8968e80
increase window size to 300
xingyaoww Jul 2, 2024
84b3358
add file beginning and ending marker to avoid looping
xingyaoww Jul 2, 2024
53ef016
Merge commit '41ddba84bd0d62f8a4bc48d08addde4b4269a687' into HEAD
xingyaoww Jul 2, 2024
26d9c90
expand the editor window to better display edit error for model
xingyaoww Jul 2, 2024
a4e41ed
refractor to breakdown edit to internal functions
xingyaoww Jul 2, 2024
eec2aa4
reduce window to 200
xingyaoww Jul 2, 2024
31ae269
move window to 100
xingyaoww Jul 2, 2024
53c36e1
refractor to cleanup some logic into _calculate_window_bounds
xingyaoww Jul 2, 2024
ef80308
Merge branch 'main' into xw/further-improve-edit
neubig Jul 3, 2024
e426298
fix integration tests
xingyaoww Jul 4, 2024
1d6a39e
fix sandbox test on new prompt
xingyaoww Jul 4, 2024
6bba835
update demonstration with new changes
xingyaoww Jul 4, 2024
738c657
fix integration
xingyaoww Jul 4, 2024
8fe5034
initialize llm inside process_instance to circumvent "AttributeError:…
xingyaoww Jul 5, 2024
d2a49aa
update kwargs
xingyaoww Jul 5, 2024
64938f5
retry for internal server error
xingyaoww Jul 5, 2024
21246fb
fix max iteration
xingyaoww Jul 5, 2024
f9cfecd
override max iter from config
xingyaoww Jul 5, 2024
4c6fa51
Merge commit 'adf1a0d55654d0065b615d0b4a6534cc5478b732' into xw/furth…
xingyaoww Jul 7, 2024
5247bfa
fix integration tests
xingyaoww Jul 7, 2024
949b38d
remove edit file by line
xingyaoww Jul 7, 2024
b4ac713
fix integration tests
xingyaoww Jul 7, 2024
06fd2c5
add instruction to avoid hanging
xingyaoww Jul 8, 2024
e690830
Revert "add instruction to avoid hanging"
xingyaoww Jul 9, 2024
57823b3
handle content policy violation error
xingyaoww Jul 10, 2024
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
Prev Previous commit
Next Next commit
initialize llm inside process_instance to circumvent "AttributeError:…
… Can't pickle local object"
  • Loading branch information
xingyaoww committed Jul 5, 2024
commit 8fe503426bf622b1bc3eb334cb528b08895d1b76
12 changes: 7 additions & 5 deletions evaluation/swe_bench/run_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,17 @@ def get_test_result(instance, sandbox, workspace_dir_name):


def process_instance(
agent: Agent,
agent_class: str,
llm_config: dict,
instance: Any,
metadata: dict,
skip_workspace_mount: bool,
eval_output_dir: str,
reset_logger: bool = True,
):
# Create the agent
agent = Agent.get_cls(agent_class)(llm=LLM(llm_config))

workspace_mount_path = os.path.join(config.workspace_mount_path, '_eval_workspace')
# create process-specific workspace dir
# if `not skip_workspace_mount` - we will create a workspace directory for EACH process
Expand Down Expand Up @@ -496,17 +500,15 @@ def update_progress(future):
skip_workspace_mount = agent_class == 'CodeActAgent'
logger.info(f'Skipping workspace mount: {skip_workspace_mount}')

# Create the agent
agent = Agent.get_cls(agent_class)(llm=LLM(config.llm))

try:
with ProcessPoolExecutor(num_workers) as executor:
futures = []
# This is how we perform multi-processing
for row_idx, instance in swe_bench_tests.iterrows():
future = executor.submit(
process_instance,
agent,
agent_class,
config.llm,
instance,
metadata,
skip_workspace_mount,
Expand Down