Skip to content

Commit 83793a0

Browse files
committed
Correctly resolve OutputIterator when passed to create()
1 parent a00b5d2 commit 83793a0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

replicate/use.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,8 +434,11 @@ def create(self, *_: Input.args, **inputs: Input.kwargs) -> Run[Output]:
434434
# Process inputs to convert concatenate OutputIterators to strings and URLPath to URLs
435435
processed_inputs = {}
436436
for key, value in inputs.items():
437-
if isinstance(value, OutputIterator) and value.is_concatenate:
438-
processed_inputs[key] = str(value)
437+
if isinstance(value, OutputIterator):
438+
if value.is_concatenate:
439+
processed_inputs[key] = str(value)
440+
else:
441+
processed_inputs[key] = list(value)
439442
elif url := get_path_url(value):
440443
processed_inputs[key] = url
441444
else:
@@ -578,8 +581,8 @@ async def create(self, *_: Input.args, **inputs: Input.kwargs) -> AsyncRun[Outpu
578581
# Process inputs to convert concatenate OutputIterators to strings and URLPath to URLs
579582
processed_inputs = {}
580583
for key, value in inputs.items():
581-
if isinstance(value, OutputIterator) and value.is_concatenate:
582-
processed_inputs[key] = str(value)
584+
if isinstance(value, OutputIterator):
585+
processed_inputs[key] = await value
583586
elif url := get_path_url(value):
584587
processed_inputs[key] = url
585588
else:

0 commit comments

Comments
 (0)