This repository was archived by the owner on Jun 3, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change 17
17
import random
18
18
import string
19
19
from os import path
20
- from typing import Dict , List , Tuple
20
+ from typing import Dict , List , Tuple , get_args
21
21
22
22
import numpy
23
23
@@ -58,15 +58,11 @@ def get_input_schema_type(pipeline: Pipeline) -> str:
58
58
if SchemaType .TEXT_SEQ in input_schema_requirements :
59
59
if input_schema_fields .get (SchemaType .TEXT_SEQ ).alias == SchemaType .TEXT_PROMPT :
60
60
return SchemaType .TEXT_PROMPT
61
- sequence_types = [
62
- f .outer_type_ for f in input_schema_fields [SchemaType .TEXT_SEQ ].sub_fields
63
- ]
61
+ sequence_types = get_args (input_schema_fields [SchemaType .TEXT_SEQ ].annotation )
64
62
if List [str ] in sequence_types :
65
63
return SchemaType .TEXT_SEQ
66
64
elif SchemaType .TEXT_INPUT in input_schema_requirements :
67
- sequence_types = [
68
- f .outer_type_ for f in input_schema_fields [SchemaType .TEXT_INPUT ].sub_fields
69
- ]
65
+ sequence_types = get_args (input_schema_fields [SchemaType .TEXT_INPUT ].annotation )
70
66
if List [str ] in sequence_types :
71
67
return SchemaType .TEXT_INPUT
72
68
elif SchemaType .QUESTION in input_schema_requirements :
You can’t perform that action at this time.
0 commit comments