DeepBeepMeep commited on
Commit
f06bcd4
·
1 Parent(s): 665907c

fixed 'metadata' config error

Browse files
Files changed (2) hide show
  1. README.md +1 -0
  2. gradio_server.py +12 -3
README.md CHANGED
@@ -256,6 +256,7 @@ You can define multiple lines of macros. If there is only one macro line, the ap
256
  --advanced : turn on the advanced mode while launching the app\
257
  --i2v-settings : path to launch settings for i2v\
258
  --t2v-settings : path to launch settings for t2v
 
259
 
260
  ### Profiles (for power users only)
261
  You can choose between 5 profiles, but two are really relevant here :
 
256
  --advanced : turn on the advanced mode while launching the app\
257
  --i2v-settings : path to launch settings for i2v\
258
  --t2v-settings : path to launch settings for t2v
259
+ --listen : make server accessible on network
260
 
261
  ### Profiles (for power users only)
262
  You can choose between 5 profiles, but two are really relevant here :
gradio_server.py CHANGED
@@ -206,6 +206,12 @@ def _parse_args():
206
  help="Enable pytorch compilation"
207
  )
208
 
 
 
 
 
 
 
209
  # parser.add_argument(
210
  # "--fast",
211
  # action="store_true",
@@ -1310,7 +1316,7 @@ def generate_video(
1310
  'num_inference_steps': num_inference_steps,
1311
  }
1312
 
1313
- metadata_choice = server_config["metadata_choice"]
1314
  if metadata_choice == "json":
1315
  with open(video_path.replace('.mp4', '.json'), 'w') as f:
1316
  json.dump(configs, f, indent=4)
@@ -2245,8 +2251,9 @@ def create_demo():
2245
  t2v_loras_choices, t2v_lset_name, t2v_header, t2v_state = generate_video_tab()
2246
  with gr.Tab("Image To Video", id="i2v") as i2v_tab:
2247
  i2v_loras_choices, i2v_lset_name, i2v_header, i2v_state = generate_video_tab(True)
2248
- with gr.Tab("Configuration"):
2249
- generate_configuration_tab()
 
2250
  with gr.Tab("About"):
2251
  generate_about_tab()
2252
  main_tabs.select(
@@ -2267,6 +2274,8 @@ if __name__ == "__main__":
2267
  if server_port == 0:
2268
  server_port = int(os.getenv("SERVER_PORT", "7860"))
2269
  server_name = args.server_name
 
 
2270
  if len(server_name) == 0:
2271
  server_name = os.getenv("SERVER_NAME", "localhost")
2272
  demo = create_demo()
 
206
  help="Enable pytorch compilation"
207
  )
208
 
209
+ parser.add_argument(
210
+ "--listen",
211
+ action="store_true",
212
+ help="Server accessible on local network"
213
+ )
214
+
215
  # parser.add_argument(
216
  # "--fast",
217
  # action="store_true",
 
1316
  'num_inference_steps': num_inference_steps,
1317
  }
1318
 
1319
+ metadata_choice = server_config.get("metadata_choice","metadata")
1320
  if metadata_choice == "json":
1321
  with open(video_path.replace('.mp4', '.json'), 'w') as f:
1322
  json.dump(configs, f, indent=4)
 
2251
  t2v_loras_choices, t2v_lset_name, t2v_header, t2v_state = generate_video_tab()
2252
  with gr.Tab("Image To Video", id="i2v") as i2v_tab:
2253
  i2v_loras_choices, i2v_lset_name, i2v_header, i2v_state = generate_video_tab(True)
2254
+ if not args.lock_config:
2255
+ with gr.Tab("Configuration"):
2256
+ generate_configuration_tab()
2257
  with gr.Tab("About"):
2258
  generate_about_tab()
2259
  main_tabs.select(
 
2274
  if server_port == 0:
2275
  server_port = int(os.getenv("SERVER_PORT", "7860"))
2276
  server_name = args.server_name
2277
+ if args.listen:
2278
+ server_name = "0.0.0.0"
2279
  if len(server_name) == 0:
2280
  server_name = os.getenv("SERVER_NAME", "localhost")
2281
  demo = create_demo()