alessandro trinca tornidor commited on
Commit
ca22ec3
·
1 Parent(s): 5c21342

[fix] fix path env variable not converted to string, bump to version 1.0.4

Browse files
lisa_on_cuda/utils/app_helpers.py CHANGED
@@ -337,5 +337,5 @@ def get_gradio_interface(
337
 
338
 
339
  if __name__ == '__main__':
340
- arrrrg = parse_args([])
341
- print("arrrrg:", arrrrg)
 
337
 
338
 
339
  if __name__ == '__main__':
340
+ parsed_args = parse_args([])
341
+ print("arrrrg:", parsed_args)
lisa_on_cuda/utils/utils.py CHANGED
@@ -46,7 +46,7 @@ ANSWER_LIST = [
46
  ]
47
  ROOT = Path(__file__).parent.parent.parent
48
  PROJECT_ROOT_FOLDER = os.getenv("PROJECT_ROOT_FOLDER", ROOT)
49
- RESOURCES_FOLDER = os.getenv("RESOURCES_FOLDER", PROJECT_ROOT_FOLDER / "resources")
50
  FASTAPI_STATIC = os.getenv("FASTAPI_STATIC", ROOT / "static")
51
  VIS_OUTPUT = os.getenv("VIS_OUTPUT", ROOT / "vis_output")
52
 
@@ -176,7 +176,7 @@ def create_placeholder_variables():
176
  import cv2
177
 
178
  try:
179
- placeholders_folder = RESOURCES_FOLDER / "placeholders"
180
  logging.info(f"placeholders_folder:{placeholders_folder}.")
181
  no_seg_out = cv2.imread(str(placeholders_folder / "no_seg_out.png"))[:, :, ::-1]
182
  error_happened = cv2.imread(str(placeholders_folder / "error_happened.png"))[:, :, ::-1]
 
46
  ]
47
  ROOT = Path(__file__).parent.parent.parent
48
  PROJECT_ROOT_FOLDER = os.getenv("PROJECT_ROOT_FOLDER", ROOT)
49
+ RESOURCES_FOLDER = os.getenv("RESOURCES_FOLDER", Path(PROJECT_ROOT_FOLDER) / "resources")
50
  FASTAPI_STATIC = os.getenv("FASTAPI_STATIC", ROOT / "static")
51
  VIS_OUTPUT = os.getenv("VIS_OUTPUT", ROOT / "vis_output")
52
 
 
176
  import cv2
177
 
178
  try:
179
+ placeholders_folder = Path(RESOURCES_FOLDER) / "placeholders"
180
  logging.info(f"placeholders_folder:{placeholders_folder}.")
181
  no_seg_out = cv2.imread(str(placeholders_folder / "no_seg_out.png"))[:, :, ::-1]
182
  error_happened = cv2.imread(str(placeholders_folder / "error_happened.png"))[:, :, ::-1]
pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
  [tool.poetry]
2
  name = "lisa-on-cuda"
3
- version = "1.0.3"
4
  description = ""
5
  authors = ["alessandro trinca tornidor <[email protected]>"]
6
  license = "Apache 2.0"
@@ -8,7 +8,7 @@ readme = "README.md"
8
 
9
  [metadata]
10
  name = "lisa-on-cuda"
11
- version = "1.0.3"
12
 
13
  [tool.poetry.dependencies]
14
  python = "~3.10"
 
1
  [tool.poetry]
2
  name = "lisa-on-cuda"
3
+ version = "1.0.4"
4
  description = ""
5
  authors = ["alessandro trinca tornidor <[email protected]>"]
6
  license = "Apache 2.0"
 
8
 
9
  [metadata]
10
  name = "lisa-on-cuda"
11
+ version = "1.0.4"
12
 
13
  [tool.poetry.dependencies]
14
  python = "~3.10"
tests/test_app_helpers.py CHANGED
@@ -14,11 +14,12 @@ class TestAppBuilders(unittest.TestCase):
14
 
15
  def test_parse_args(self):
16
  from lisa_on_cuda.utils import app_helpers
 
17
 
18
  test_args_parse = app_helpers.parse_args([])
19
  assert vars(test_args_parse) == {
20
  'version': 'xinlai/LISA-13B-llama2-v1-explanatory',
21
- 'vis_save_path': './vis_output',
22
  'precision': 'fp16',
23
  'image_size': 1024,
24
  'model_max_length': 512,
 
14
 
15
  def test_parse_args(self):
16
  from lisa_on_cuda.utils import app_helpers
17
+ from lisa_on_cuda.utils import utils
18
 
19
  test_args_parse = app_helpers.parse_args([])
20
  assert vars(test_args_parse) == {
21
  'version': 'xinlai/LISA-13B-llama2-v1-explanatory',
22
+ 'vis_save_path': str(utils.VIS_OUTPUT),
23
  'precision': 'fp16',
24
  'image_size': 1024,
25
  'model_max_length': 512,