made string names of interfaces case insensitive

This commit is contained in:
Abubakar Abid 2020-07-01 11:48:59 -05:00
parent e9d697e108
commit 13ee3abcb6

View File

@ -40,7 +40,7 @@ class Interface:
""" """
def get_input_instance(iface): def get_input_instance(iface):
if isinstance(iface, str): if isinstance(iface, str):
return gradio.inputs.shortcuts[iface] return gradio.inputs.shortcuts[iface.lower()]
elif isinstance(iface, gradio.inputs.AbstractInput): elif isinstance(iface, gradio.inputs.AbstractInput):
return iface return iface
else: else:
@ -49,7 +49,7 @@ class Interface:
def get_output_instance(iface): def get_output_instance(iface):
if isinstance(iface, str): if isinstance(iface, str):
return gradio.outputs.shortcuts[iface] return gradio.outputs.shortcuts[iface.lower()]
elif isinstance(iface, gradio.outputs.AbstractOutput): elif isinstance(iface, gradio.outputs.AbstractOutput):
return iface return iface
else: else:
@ -264,7 +264,7 @@ class Interface:
if share: if share:
try: try:
share_url = networking.setup_tunnel(server_port) share_url = networking.setup_tunnel(server_port)
print(share_url) print("External URL:", share_url)
except RuntimeError: except RuntimeError:
share_url = None share_url = None
if self.verbose: if self.verbose: