Skip to content
Python

fixed 'metadata' config error

DeepBeepMeepf9910b3c4dfc
diff --git a/README.md b/README.md
index 50bf85a..c69848b 100644
--- a/README.md
+++ b/README.md
@@ -256,6 +256,7 @@ You can define multiple lines of macros. If there is only one macro line, the ap
--advanced : turn on the advanced mode while launching the app\
--i2v-settings : path to launch settings for i2v\
--t2v-settings : path to launch settings for t2v
+--listen : make server accessible on network
### Profiles (for power users only)
You can choose between 5 profiles, but two are really relevant here :
diff --git a/gradio_server.py b/gradio_server.py
index 65b14ce..674d6df 100644
--- a/gradio_server.py
+++ b/gradio_server.py
@@ -206,6 +206,12 @@ def _parse_args():
help="Enable pytorch compilation"
)
+ parser.add_argument(
+ "--listen",
+ action="store_true",
+ help="Server accessible on local network"
+ )
+
# parser.add_argument(
# "--fast",
# action="store_true",
@@ -1310,7 +1316,7 @@ def generate_video(
'num_inference_steps': num_inference_steps,
}
- metadata_choice = server_config["metadata_choice"]
+ metadata_choice = server_config.get("metadata_choice","metadata")
if metadata_choice == "json":
with open(video_path.replace('.mp4', '.json'), 'w') as f:
json.dump(configs, f, indent=4)
@@ -2245,8 +2251,9 @@ def create_demo():
t2v_loras_choices, t2v_lset_name, t2v_header, t2v_state = generate_video_tab()
with gr.Tab("Image To Video", id="i2v") as i2v_tab:
i2v_loras_choices, i2v_lset_name, i2v_header, i2v_state = generate_video_tab(True)
- with gr.Tab("Configuration"):
- generate_configuration_tab()
+ if not args.lock_config:
+ with gr.Tab("Configuration"):
+ generate_configuration_tab()
with gr.Tab("About"):
generate_about_tab()
main_tabs.select(
@@ -2267,6 +2274,8 @@ if __name__ == "__main__":
if server_port == 0:
server_port = int(os.getenv("SERVER_PORT", "7860"))
server_name = args.server_name
+ if args.listen:
+ server_name = "0.0.0.0"
if len(server_name) == 0:
server_name = os.getenv("SERVER_NAME", "localhost")
demo = create_demo()