mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
dont cast text
This commit is contained in:
parent
f03c01f9a8
commit
6855333b91
@ -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):
|
||||||
|
@ -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])
|
||||||
|
Loading…
Reference in New Issue
Block a user