mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-27 02:30:17 +08:00
support for paths
This commit is contained in:
parent
8073ed405f
commit
1193b6e2b7
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user