fendiprime commited on
Commit
8adaf25
1 Parent(s): 6b57667

Add working url for model

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -3,6 +3,7 @@ os.system('git clone https://github.com/facebookresearch/detectron2.git')
3
  os.system('pip install -e detectron2')
4
  os.system("git clone https://github.com/microsoft/unilm.git")
5
  os.system("sed -i 's/from collections import Iterable/from collections.abc import Iterable/' unilm/dit/object_detection/ditod/table_evaluation/data_structure.py")
 
6
 
7
  import sys
8
  sys.path.append("unilm")
@@ -30,7 +31,7 @@ add_vit_config(cfg)
30
  cfg.merge_from_file("cascade_dit_base.yml")
31
 
32
  # Step 2: add model weights URL to config
33
- cfg.MODEL.WEIGHTS = "https://layoutlm.blob.core.windows.net/dit/dit-fts/publaynet_dit-b_cascade.pth?sv=2022-11-02&ss=b&srt=o&sp=r&se=2033-06-08T16:48:15Z&st=2023-06-08T08:48:15Z&spr=https&sig=a9VXrihTzbWyVfaIDlIT1Z0FoR1073VB0RLQUMuudD4%3D"
34
 
35
  # Step 3: set device
36
  cfg.MODEL.DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
 
3
  os.system('pip install -e detectron2')
4
  os.system("git clone https://github.com/microsoft/unilm.git")
5
  os.system("sed -i 's/from collections import Iterable/from collections.abc import Iterable/' unilm/dit/object_detection/ditod/table_evaluation/data_structure.py")
6
+ os.system("curl -LJ -o publaynet_dit-b_cascade.pth 'https://layoutlm.blob.core.windows.net/dit/dit-fts/publaynet_dit-b_cascade.pth?sv=2022-11-02&ss=b&srt=o&sp=r&se=2033-06-08T16:48:15Z&st=2023-06-08T08:48:15Z&spr=https&sig=a9VXrihTzbWyVfaIDlIT1Z0FoR1073VB0RLQUMuudD4%3D'")
7
 
8
  import sys
9
  sys.path.append("unilm")
 
31
  cfg.merge_from_file("cascade_dit_base.yml")
32
 
33
  # Step 2: add model weights URL to config
34
+ cfg.MODEL.WEIGHTS = "publaynet_dit-b_cascade.pth"
35
 
36
  # Step 3: set device
37
  cfg.MODEL.DEVICE = "cuda" if torch.cuda.is_available() else "cpu"