update gradio_web_server.py
Browse files- gradio_web_server.py +9 -4
gradio_web_server.py
CHANGED
@@ -68,7 +68,7 @@ def get_model_list():
|
|
68 |
models = ret.json()["models"]
|
69 |
models = sort_models(models)
|
70 |
|
71 |
-
logger.info(f"Models: {models}")
|
72 |
return models
|
73 |
|
74 |
|
@@ -534,7 +534,12 @@ function createWaveAnimation() {
|
|
534 |
}, 200);
|
535 |
const params = new URLSearchParams(window.location.search);
|
536 |
url_params = Object.fromEntries(params);
|
537 |
-
console.log(url_params);
|
|
|
|
|
|
|
|
|
|
|
538 |
return url_params;
|
539 |
}
|
540 |
|
@@ -780,14 +785,14 @@ def build_demo(embed_mode):
|
|
780 |
load_demo,
|
781 |
[url_params],
|
782 |
[state, model_selector],
|
783 |
-
js=
|
784 |
)
|
785 |
elif args.model_list_mode == "reload":
|
786 |
demo.load(
|
787 |
load_demo_refresh_model_list,
|
788 |
None,
|
789 |
[state, model_selector],
|
790 |
-
js=
|
791 |
)
|
792 |
else:
|
793 |
raise ValueError(f"Unknown model list mode: {args.model_list_mode}")
|
|
|
68 |
models = ret.json()["models"]
|
69 |
models = sort_models(models)
|
70 |
|
71 |
+
logger.info(f"Models (from {args.controller_url}): {models}")
|
72 |
return models
|
73 |
|
74 |
|
|
|
534 |
}, 200);
|
535 |
const params = new URLSearchParams(window.location.search);
|
536 |
url_params = Object.fromEntries(params);
|
537 |
+
// console.log(url_params);
|
538 |
+
// console.log('hello world...');
|
539 |
+
// console.log(window.location.search);
|
540 |
+
// console.log('hello world...');
|
541 |
+
// alert(window.location.search)
|
542 |
+
// alert(url_params);
|
543 |
return url_params;
|
544 |
}
|
545 |
|
|
|
785 |
load_demo,
|
786 |
[url_params],
|
787 |
[state, model_selector],
|
788 |
+
js=get_window_url_params,
|
789 |
)
|
790 |
elif args.model_list_mode == "reload":
|
791 |
demo.load(
|
792 |
load_demo_refresh_model_list,
|
793 |
None,
|
794 |
[state, model_selector],
|
795 |
+
js=get_window_url_params,
|
796 |
)
|
797 |
else:
|
798 |
raise ValueError(f"Unknown model list mode: {args.model_list_mode}")
|