updated PyPi version

This commit is contained in:
Abubakar Abid 2020-07-08 13:15:12 -05:00
parent b27920560a
commit a04dfd592c
4 changed files with 11 additions and 13 deletions

View File

@ -14,7 +14,7 @@ from gradio.tunneling import create_tunnel
import urllib.request
from shutil import copyfile
import requests
import os
import sys
INITIAL_PORT_VALUE = (
@ -117,7 +117,6 @@ def get_first_available_port(initial, final):
def serve_files_in_background(interface, port, directory_to_serve=None, server_name=LOCALHOST_NAME):
class HTTPHandler(SimpleHTTPRequestHandler):
"""This handler uses server.base_path instead of always using os.getcwd()"""
def _set_headers(self):
self.send_response(200)
self.send_header("Content-type", "application/json")
@ -134,7 +133,6 @@ def serve_files_in_background(interface, port, directory_to_serve=None, server_n
def do_POST(self):
# Read body of the request.
if self.path == "/api/predict/":
# Make the prediction.
self._set_headers()
@ -198,12 +196,13 @@ def serve_files_in_background(interface, port, directory_to_serve=None, server_n
# Now loop forever
def serve_forever():
# try:
while True:
# sys.stdout.flush()
httpd.serve_forever()
# except (KeyboardInterrupt, OSError):
# httpd.server_close()
try:
while True:
sys.stdout.flush()
httpd.serve_forever()
except (KeyboardInterrupt, OSError):
httpd.shutdown()
httpd.server_close()
thread = threading.Thread(target=serve_forever, daemon=False)
thread.start()
@ -215,13 +214,11 @@ def start_simple_server(interface, directory_to_serve=None, server_name=None):
port = get_first_available_port(
INITIAL_PORT_VALUE, INITIAL_PORT_VALUE + TRY_NUM_PORTS
)
httpd = serve_files_in_background(
interface, port, directory_to_serve, server_name)
httpd = serve_files_in_background(interface, port, directory_to_serve, server_name)
return port, httpd
def close_server(server):
server.shutdown()
server.server_close()

BIN
dist/gradio-0.9.9.2-py3-none-any.whl vendored Normal file

Binary file not shown.

View File

@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: gradio
Version: 0.9.9.1
Version: 0.9.9.2
Summary: Python library for easily interacting with trained machine learning models
Home-page: https://github.com/gradio-app/gradio-UI
Author: Abubakar Abid

View File

@ -4,3 +4,4 @@ paramiko
scipy
IPython
scikit-image
analytics-python