Skip to content

Commit

Permalink
fix: copy dataset list to avoid side-effect
Browse files Browse the repository at this point in the history
  • Loading branch information
link89 committed Nov 28, 2023
1 parent e8e5fd7 commit 8cdd514
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ai2_kit/domain/deepmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async def cll_deepmd(input: CllDeepmdInput, ctx: CllDeepmdContext):
model_paths = executor.run_python_fn(expand_globs)(input.config.fixture_models)
assert len(model_paths) > 0, f'No fixture models found: {input.config.fixture_models}'
return GenericDeepmdOutput(
dataset=input.old_dataset,
dataset=input.old_dataset.copy(),
models=[Artifact.of(url=url, format=DataFormat.DEEPMD_MODEL)
for url in model_paths]
)
Expand All @@ -131,7 +131,7 @@ async def cll_deepmd(input: CllDeepmdInput, ctx: CllDeepmdContext):
init_dataset = ctx.resource_manager.resolve_artifacts(input.config.init_dataset)
# input dataset contains data that generated by previous iteration
# it should not contain the initial dataset
input_dataset: List[Artifact] = input.old_dataset
input_dataset: List[Artifact] = input.old_dataset.copy()

# make new dataset from raw data
new_dataset, outlier_dataset = executor.run_python_fn(make_deepmd_dataset)(
Expand Down

0 comments on commit 8cdd514

Please sign in to comment.