From 6855333b916274e92d3bbd283fd9a629d136673d Mon Sep 17 00:00:00 2001 From: Ali Abid Date: Mon, 21 Sep 2020 14:12:35 -0700 Subject: [PATCH] dont cast text --- gradio/interpretation.py | 1 - gradio/networking.py | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gradio/interpretation.py b/gradio/interpretation.py index ba029bd8c6..03a21f13b8 100644 --- a/gradio/interpretation.py +++ b/gradio/interpretation.py @@ -6,7 +6,6 @@ import numpy as np expected_types = { Image: "numpy", - Textbox: "str" } def default(separator=" ", n_segments=20): diff --git a/gradio/networking.py b/gradio/networking.py index dc7a8d6575..2ac005c596 100644 --- a/gradio/networking.py +++ b/gradio/networking.py @@ -143,7 +143,9 @@ def interpret(): processed_input = [] for i, x in enumerate(raw_input): 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)) else: processed_input = [input_interface.preprocess(raw_input[i])