alessandro trinca tornidor commited on
Commit
57d987a
·
1 Parent(s): 910b241

[feat] add ROOT_PROJECT ENV variable

Browse files
lisa_on_cuda/__version__.py ADDED
@@ -0,0 +1 @@
 
 
1
+ __version__ = "0.2.0"
lisa_on_cuda/utils/app_helpers.py CHANGED
@@ -2,6 +2,7 @@ import argparse
2
  import logging
3
  import os
4
  import re
 
5
  from typing import Callable
6
  import cv2
7
  import gradio as gr
@@ -23,9 +24,11 @@ placeholders = utils.create_placeholder_variables()
23
 
24
  @session_logger.set_uuid_logging
25
  def parse_args(args_to_parse):
 
 
26
  parser = argparse.ArgumentParser(description="LISA chat")
27
  parser.add_argument("--version", default="xinlai/LISA-13B-llama2-v1-explanatory")
28
- parser.add_argument("--vis_save_path", default="./vis_output", type=str)
29
  parser.add_argument(
30
  "--precision",
31
  default="fp16",
@@ -333,3 +336,8 @@ def get_gradio_interface(
333
  examples=constants.examples,
334
  allow_flagging="auto"
335
  )
 
 
 
 
 
 
2
  import logging
3
  import os
4
  import re
5
+ from pathlib import Path
6
  from typing import Callable
7
  import cv2
8
  import gradio as gr
 
24
 
25
  @session_logger.set_uuid_logging
26
  def parse_args(args_to_parse):
27
+ print(f"ROOT_PROJECT:{utils.ROOT_PROJECT}.")
28
+ logging.info(f"ROOT_PROJECT:{utils.ROOT_PROJECT}.")
29
  parser = argparse.ArgumentParser(description="LISA chat")
30
  parser.add_argument("--version", default="xinlai/LISA-13B-llama2-v1-explanatory")
31
+ parser.add_argument("--vis_save_path", default=str(Path(utils.ROOT_PROJECT) / "vis_output"), type=str)
32
  parser.add_argument(
33
  "--precision",
34
  default="fp16",
 
336
  examples=constants.examples,
337
  allow_flagging="auto"
338
  )
339
+
340
+
341
+ if __name__ == '__main__':
342
+ arrrrg = parse_args([])
343
+ print("arrrrg:", arrrrg)
lisa_on_cuda/utils/utils.py CHANGED
@@ -1,4 +1,5 @@
1
  import logging
 
2
  from enum import Enum
3
  from pathlib import Path
4
 
@@ -44,6 +45,7 @@ ANSWER_LIST = [
44
  "[SEG].",
45
  ]
46
  ROOT = Path(__file__).parent.parent.parent
 
47
 
48
 
49
  class Summary(Enum):
 
1
  import logging
2
+ import os
3
  from enum import Enum
4
  from pathlib import Path
5
 
 
45
  "[SEG].",
46
  ]
47
  ROOT = Path(__file__).parent.parent.parent
48
+ ROOT_PROJECT = os.getenv("ROOT_PROJECT", ROOT)
49
 
50
 
51
  class Summary(Enum):
pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
  [tool.poetry]
2
  name = "lisa-on-cuda"
3
- version = "0.1.0"
4
  description = ""
5
  authors = ["alessandro trinca tornidor <[email protected]>"]
6
  license = "Apache 2.0"
 
1
  [tool.poetry]
2
  name = "lisa-on-cuda"
3
+ version = "0.2.0"
4
  description = ""
5
  authors = ["alessandro trinca tornidor <[email protected]>"]
6
  license = "Apache 2.0"