Skip to content

Commit 728563d

Browse files
committed
Simplify
1 parent 2f5061b commit 728563d

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

  • app/grandchallenge/components/backends

app/grandchallenge/components/backends/base.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from django.utils.functional import cached_property
3333
from panimg.image_builders import image_builder_mhd, image_builder_tiff
3434
from pydantic import BaseModel, ConfigDict
35-
from pydantic_core import to_jsonable_python
35+
from pydantic_core import to_json
3636

3737
from grandchallenge.cases.tasks import import_images
3838
from grandchallenge.components.backends.exceptions import (
@@ -688,19 +688,17 @@ def _get_civ_provisioning_tasks(self, *, civ, input_prefixes):
688688

689689
def _get_create_invocation_json_task(self, *, invocation_inputs):
690690
return self._get_upload_input_content_task(
691-
content=json.dumps(
692-
to_jsonable_python(
693-
[
694-
InferenceTask(
695-
pk=self._job_id,
696-
inputs=invocation_inputs,
697-
output_bucket_name=settings.COMPONENTS_OUTPUT_BUCKET_NAME,
698-
output_prefix=self._io_prefix,
699-
timeout=self._time_limit,
700-
)
701-
]
702-
)
703-
).encode("utf-8"),
691+
content=to_json(
692+
[
693+
InferenceTask(
694+
pk=self._job_id,
695+
inputs=invocation_inputs,
696+
output_bucket_name=settings.COMPONENTS_OUTPUT_BUCKET_NAME,
697+
output_prefix=self._io_prefix,
698+
timeout=self._time_limit,
699+
)
700+
]
701+
),
704702
key=self._invocation_key,
705703
)
706704

0 commit comments

Comments
 (0)