liuyizhang commited on
Commit
63057ef
1 Parent(s): ecc6ad2

update app.py

Browse files
Files changed (2) hide show
  1. app.py +7 -5
  2. requirements.txt +4 -2
app.py CHANGED
@@ -5,8 +5,7 @@ warnings.filterwarnings('ignore')
5
  import subprocess, io, os, sys, time
6
  # os.system("pip install gradio==3.36.1")
7
  os.system("pip install gradio==3.40.1")
8
- # os.system("pip install transformers==4.33.2")
9
- # os.system("pip install transformers==4.30.0")
10
  import gradio as gr
11
 
12
  from loguru import logger
@@ -76,6 +75,9 @@ if lama_cleaner_enable:
76
  import ast
77
  from kosmos_utils import *
78
 
 
 
 
79
  config_file = 'GroundingDINO/groundingdino/config/GroundingDINO_SwinT_OGC.py'
80
  ckpt_repo_id = "ShilongLiu/GroundingDINO"
81
  ckpt_filenmae = "groundingdino_swint_ogc.pth"
@@ -794,9 +796,6 @@ def get_model_device(module):
794
  except Exception as e:
795
  return 'Error'
796
 
797
- ram_enable = True
798
- kosmos_enable = False
799
-
800
  task_types = ["detection", "segment", "inpainting"]
801
  if lama_cleaner_enable:
802
  task_types.append("remove")
@@ -812,6 +811,9 @@ if __name__ == "__main__":
812
  args = parser.parse_args()
813
  print(f'args = {args}')
814
 
 
 
 
815
  set_device()
816
 
817
  if os.environ.get('IS_MY_DEBUG') is None and kosmos_enable:
 
5
  import subprocess, io, os, sys, time
6
  # os.system("pip install gradio==3.36.1")
7
  os.system("pip install gradio==3.40.1")
8
+ # os.system("pip install transformers==4.32.0")
 
9
  import gradio as gr
10
 
11
  from loguru import logger
 
75
  import ast
76
  from kosmos_utils import *
77
 
78
+ ram_enable = True
79
+ kosmos_enable = True
80
+
81
  config_file = 'GroundingDINO/groundingdino/config/GroundingDINO_SwinT_OGC.py'
82
  ckpt_repo_id = "ShilongLiu/GroundingDINO"
83
  ckpt_filenmae = "groundingdino_swint_ogc.pth"
 
796
  except Exception as e:
797
  return 'Error'
798
 
 
 
 
799
  task_types = ["detection", "segment", "inpainting"]
800
  if lama_cleaner_enable:
801
  task_types.append("remove")
 
811
  args = parser.parse_args()
812
  print(f'args = {args}')
813
 
814
+ if os.environ.get('IS_MY_DEBUG') is None:
815
+ os.system("pip list")
816
+
817
  set_device()
818
 
819
  if os.environ.get('IS_MY_DEBUG') is None and kosmos_enable:
requirements.txt CHANGED
@@ -17,8 +17,6 @@ termcolor
17
  timm
18
  torch
19
  torchvision
20
- transformers==4.27.4
21
- # transformers@git+https://github.com/huggingface/transformers.git@main
22
  yapf
23
  numba
24
  scipy
@@ -28,5 +26,9 @@ sentencepiece
28
  loguru
29
 
30
  lama-cleaner==1.2.3
 
 
 
 
31
  openmim==0.3.9
32
  mmcv==2.0.0
 
17
  timm
18
  torch
19
  torchvision
 
 
20
  yapf
21
  numba
22
  scipy
 
26
  loguru
27
 
28
  lama-cleaner==1.2.3
29
+
30
+ transformers==4.32.0
31
+ # transformers@git+https://github.com/huggingface/transformers.git@main
32
+
33
  openmim==0.3.9
34
  mmcv==2.0.0