deepkyu commited on
Commit
db4b904
1 Parent(s): 4dc440b

[hotifx] app.py to run in huggingface spaces

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -10,17 +10,17 @@ dest_path_config = Path('checkpoints/BK-SDM-Small_iter50000/unet/config.json')
10
  dest_path_torch_ckpt = Path('checkpoints/BK-SDM-Small_iter50000/unet/diffusion_pytorch_model.bin')
11
  BK_SDM_CONFIG_URL: str = os.getenv('BK_SDM_CONFIG_URL', None)
12
  BK_SDM_TORCH_CKPT_URL: str = os.getenv('BK_SDM_TORCH_CKPT_URL', None)
13
- assert BK_SDM_CONFIG_URL is not None
14
- assert BK_SDM_TORCH_CKPT_URL is not None
15
-
16
- subprocess.call(
17
- f"wget --no-check-certificate -O {dest_path_config} {BK_SDM_CONFIG_URL}",
18
- shell=True
19
- )
20
- subprocess.call(
21
- f"wget --no-check-certificate -O {dest_path_torch_ckpt} {BK_SDM_TORCH_CKPT_URL}",
22
- shell=True
23
- )
24
 
25
  if __name__ == "__main__":
26
  servicer = SdmCompressionDemo()
@@ -80,4 +80,4 @@ if __name__ == "__main__":
80
 
81
  demo.queue(concurrency_count=1)
82
  # demo.launch()
83
- demo.launch(server_name="0.0.0.0", server_port=7861)
 
10
  dest_path_torch_ckpt = Path('checkpoints/BK-SDM-Small_iter50000/unet/diffusion_pytorch_model.bin')
11
  BK_SDM_CONFIG_URL: str = os.getenv('BK_SDM_CONFIG_URL', None)
12
  BK_SDM_TORCH_CKPT_URL: str = os.getenv('BK_SDM_TORCH_CKPT_URL', None)
13
+ # assert BK_SDM_CONFIG_URL is not None
14
+ # assert BK_SDM_TORCH_CKPT_URL is not None
15
+
16
+ # subprocess.call(
17
+ # f"wget --no-check-certificate -O {dest_path_config} {BK_SDM_CONFIG_URL}",
18
+ # shell=True
19
+ # )
20
+ # subprocess.call(
21
+ # f"wget --no-check-certificate -O {dest_path_torch_ckpt} {BK_SDM_TORCH_CKPT_URL}",
22
+ # shell=True
23
+ # )
24
 
25
  if __name__ == "__main__":
26
  servicer = SdmCompressionDemo()
 
80
 
81
  demo.queue(concurrency_count=1)
82
  # demo.launch()
83
+ demo.launch()