diff --git a/gradio/interface.py b/gradio/interface.py index 8d0a0d9508..2f06016482 100644 --- a/gradio/interface.py +++ b/gradio/interface.py @@ -15,6 +15,7 @@ import pkg_resources import requests import random import time +from IPython import get_ipython LOCALHOST_IP = "127.0.0.1" TRY_NUM_PORTS = 100 @@ -136,7 +137,7 @@ class Interface: Method that calls the relevant method of the model object to make a prediction. :param preprocessed_input: the preprocessed input returned by the input interface """ - print(preprocessed_input.shape) + # print(preprocessed_input.shape) if self.model_type == "sklearn": return self.model_obj.predict(preprocessed_input) elif self.model_type == "keras": @@ -307,7 +308,7 @@ class Interface: path_to_local_server ) # Open a browser tab with the interface. if inline: - from IPython.display import IFrame + from IPython.display import IFrame, display if ( is_colab diff --git a/test.py b/test.py new file mode 100644 index 0000000000..55ae85164f --- /dev/null +++ b/test.py @@ -0,0 +1,19 @@ +# encoding: utf8 + +""" +Created on 2019.07.14 + +@author: yalei +""" + + +import gradio + +# A very simplistic function that capitalizes each letter in the given string +def big(x): + return x.upper() + +io = gradio.Interface(inputs="textbox", outputs="textbox", + model=big, model_type='pyfunc') +# io.launch(inline=False, inbrowser=True, share=True) +io.launch() \ No newline at end of file