heheyas commited on
Commit
58395cb
1 Parent(s): 1d0e93e
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -148,7 +148,7 @@ def change_model_params(model, min_cfg, max_cfg):
148
 
149
 
150
  @spaces.GPU
151
- def launch(device="cuda", port=4321, share=False):
152
  model_config = "./scripts/pub/configs/V3D_512.yaml"
153
  num_frames = OmegaConf.load(
154
  model_config
@@ -261,19 +261,18 @@ def launch(device="cuda", port=4321, share=False):
261
  # rembg_session,
262
  # output_folder,
263
  # )
264
- demo.launch(
265
- inbrowser=True, inline=False, server_port=port, share=share, show_error=True
266
- )
267
 
268
 
269
  if __name__ == "__main__":
270
  parser = argparse.ArgumentParser()
271
- parser.add_argument("--port", type=int, default=4321)
272
  parser.add_argument("--device", type=str, default="cuda")
273
  parser.add_argument("--share", action="store_true")
274
 
275
  opt = parser.parse_args()
276
 
 
 
277
  def download_if_need(path, url):
278
  if Path(path).exists():
279
  return
@@ -291,5 +290,4 @@ if __name__ == "__main__":
291
  "ckpts/V3D_512.ckpt", "https://huggingface.co/heheyas/V3D/resolve/main/V3D.ckpt"
292
  )
293
 
294
- test = OmegaConf.load("./scripts/pub/configs/V3D_512.yaml")
295
- launch(opt.device, opt.port, opt.share)
 
148
 
149
 
150
  @spaces.GPU
151
+ def launch(device="cuda", share=False):
152
  model_config = "./scripts/pub/configs/V3D_512.yaml"
153
  num_frames = OmegaConf.load(
154
  model_config
 
261
  # rembg_session,
262
  # output_folder,
263
  # )
264
+ demo.launch(inbrowser=True, inline=False, share=share, show_error=True)
 
 
265
 
266
 
267
  if __name__ == "__main__":
268
  parser = argparse.ArgumentParser()
 
269
  parser.add_argument("--device", type=str, default="cuda")
270
  parser.add_argument("--share", action="store_true")
271
 
272
  opt = parser.parse_args()
273
 
274
+ test = OmegaConf.load("./scripts/pub/configs/V3D_512.yaml")
275
+
276
  def download_if_need(path, url):
277
  if Path(path).exists():
278
  return
 
290
  "ckpts/V3D_512.ckpt", "https://huggingface.co/heheyas/V3D/resolve/main/V3D.ckpt"
291
  )
292
 
293
+ launch(opt.device, opt.share)