diff --git a/gradio/interface.py b/gradio/interface.py index cffaafdd26..05de99e31e 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 @@ -134,6 +135,8 @@ 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) if self.model_type == "sklearn": return self.model_obj.predict(preprocessed_input) elif self.model_type == "keras": @@ -304,7 +307,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/gradio/networking.py b/gradio/networking.py index a935d64866..441ea4ad04 100644 --- a/gradio/networking.py +++ b/gradio/networking.py @@ -276,7 +276,7 @@ def serve_files_in_background(interface, port, directory_to_serve=None): # except (KeyboardInterrupt, OSError): # httpd.server_close() - thread = threading.Thread(target=serve_forever, daemon=True) + thread = threading.Thread(target=serve_forever, daemon=False) thread.start() return httpd