support for paths

This commit is contained in:
Abubakar Abid 2021-05-06 15:45:32 -04:00
parent 8073ed405f
commit 1193b6e2b7

View File

@ -126,9 +126,12 @@ def get_gradio_interface(model_name, api_key):
return interface_info
def load_interface(model, src, api_key=None, verbose=True):
def load_interface(name, src=None, api_key=None, verbose=True):
if src is None:
src, name = name.split("/")
assert src.lower() in repos, "parameter: src must be one of {}".format(repos.keys())
interface_info = repos[src](model, api_key)
interface_info = repos[src](name, api_key)
return Interface(**interface_info)
repos = {