mirror of
https://github.com/gradio-app/gradio.git
synced 2025-01-24 10:54:04 +08:00
support for paths
This commit is contained in:
parent
f2ff783277
commit
ba461efede
@ -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