dont cast text

This commit is contained in:
Ali Abid 2020-09-21 14:12:35 -07:00
parent f03c01f9a8
commit 6855333b91
2 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,6 @@ import numpy as np
expected_types = { expected_types = {
Image: "numpy", Image: "numpy",
Textbox: "str"
} }
def default(separator=" ", n_segments=20): def default(separator=" ", n_segments=20):

View File

@ -143,7 +143,9 @@ def interpret():
processed_input = [] processed_input = []
for i, x in enumerate(raw_input): for i, x in enumerate(raw_input):
input_interface = copy.deepcopy(app.interface.input_interfaces[i]) input_interface = copy.deepcopy(app.interface.input_interfaces[i])
input_interface.type = gr.interpretation.expected_types[type(input_interface)] interface_type = type(input_interface)
if interface_type in gr.interpretation.expected_types:
input_interface.type = [gr.interpretation.expected_types[interface_type]]
processed_input.append(input_interface.preprocess(x)) processed_input.append(input_interface.preprocess(x))
else: else:
processed_input = [input_interface.preprocess(raw_input[i]) processed_input = [input_interface.preprocess(raw_input[i])