alessandro trinca tornidor commited on
Commit
ae85d7f
·
1 Parent(s): 1eba0db

[fix] try use default case on ROOT/static when env FASTAPI_STATIC is not defined, bump to version 1.0.2

Browse files
lisa_on_cuda/app/main.py CHANGED
@@ -7,7 +7,7 @@ from fastapi.staticfiles import StaticFiles
7
  from fastapi.templating import Jinja2Templates
8
 
9
  from . import routes
10
- from ..utils import app_helpers, session_logger
11
 
12
 
13
  session_logger.change_logging(logging.DEBUG)
@@ -16,9 +16,8 @@ CUSTOM_GRADIO_PATH = "/"
16
  app = FastAPI(title="lisa_app", version="1.0")
17
  app.include_router(routes.router)
18
 
19
- FASTAPI_STATIC = os.getenv("FASTAPI_STATIC")
20
- os.makedirs(FASTAPI_STATIC, exist_ok=True)
21
- app.mount("/static", StaticFiles(directory=FASTAPI_STATIC), name="static")
22
  templates = Jinja2Templates(directory="templates")
23
 
24
 
 
7
  from fastapi.templating import Jinja2Templates
8
 
9
  from . import routes
10
+ from ..utils import app_helpers, session_logger, utils
11
 
12
 
13
  session_logger.change_logging(logging.DEBUG)
 
16
  app = FastAPI(title="lisa_app", version="1.0")
17
  app.include_router(routes.router)
18
 
19
+ os.makedirs(utils.FASTAPI_STATIC, exist_ok=True)
20
+ app.mount("/static", StaticFiles(directory=utils.FASTAPI_STATIC), name="static")
 
21
  templates = Jinja2Templates(directory="templates")
22
 
23
 
lisa_on_cuda/utils/utils.py CHANGED
@@ -46,6 +46,7 @@ ANSWER_LIST = [
46
  ]
47
  ROOT = Path(__file__).parent.parent.parent
48
  PROJECT_ROOT_FOLDER = os.getenv("PROJECT_ROOT_FOLDER", ROOT)
 
49
  VIS_OUTPUT = os.getenv("VIS_OUTPUT", ROOT / "vis_output")
50
 
51
 
 
46
  ]
47
  ROOT = Path(__file__).parent.parent.parent
48
  PROJECT_ROOT_FOLDER = os.getenv("PROJECT_ROOT_FOLDER", ROOT)
49
+ FASTAPI_STATIC = os.getenv("FASTAPI_STATIC", ROOT / "static")
50
  VIS_OUTPUT = os.getenv("VIS_OUTPUT", ROOT / "vis_output")
51
 
52
 
poetry.lock CHANGED
@@ -1553,9 +1553,8 @@ files = [
1553
 
1554
  [package.dependencies]
1555
  numpy = [
1556
- {version = ">=1.23.5", markers = "python_version >= \"3.11\""},
1557
- {version = ">=1.21.4", markers = "python_version >= \"3.10\" and platform_system == \"Darwin\" and python_version < \"3.11\""},
1558
- {version = ">=1.21.2", markers = "platform_system != \"Darwin\" and python_version >= \"3.10\" and python_version < \"3.11\""},
1559
  ]
1560
 
1561
  [[package]]
@@ -1628,64 +1627,6 @@ files = [
1628
  {file = "packaging-24.0.tar.gz", hash = "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9"},
1629
  ]
1630
 
1631
- [[package]]
1632
- name = "pandas"
1633
- version = "2.1.0"
1634
- description = "Powerful data structures for data analysis, time series, and statistics"
1635
- optional = false
1636
- python-versions = ">=3.9"
1637
- files = [
1638
- {file = "pandas-2.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:40dd20439ff94f1b2ed55b393ecee9cb6f3b08104c2c40b0cb7186a2f0046242"},
1639
- {file = "pandas-2.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d4f38e4fedeba580285eaac7ede4f686c6701a9e618d8a857b138a126d067f2f"},
1640
- {file = "pandas-2.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6e6a0fe052cf27ceb29be9429428b4918f3740e37ff185658f40d8702f0b3e09"},
1641
- {file = "pandas-2.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d81e1813191070440d4c7a413cb673052b3b4a984ffd86b8dd468c45742d3cc"},
1642
- {file = "pandas-2.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:eb20252720b1cc1b7d0b2879ffc7e0542dd568f24d7c4b2347cb035206936421"},
1643
- {file = "pandas-2.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:38f74ef7ebc0ffb43b3d633e23d74882bce7e27bfa09607f3c5d3e03ffd9a4a5"},
1644
- {file = "pandas-2.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cda72cc8c4761c8f1d97b169661f23a86b16fdb240bdc341173aee17e4d6cedd"},
1645
- {file = "pandas-2.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d97daeac0db8c993420b10da4f5f5b39b01fc9ca689a17844e07c0a35ac96b4b"},
1646
- {file = "pandas-2.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8c58b1113892e0c8078f006a167cc210a92bdae23322bb4614f2f0b7a4b510f"},
1647
- {file = "pandas-2.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:629124923bcf798965b054a540f9ccdfd60f71361255c81fa1ecd94a904b9dd3"},
1648
- {file = "pandas-2.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:70cf866af3ab346a10debba8ea78077cf3a8cd14bd5e4bed3d41555a3280041c"},
1649
- {file = "pandas-2.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:d53c8c1001f6a192ff1de1efe03b31a423d0eee2e9e855e69d004308e046e694"},
1650
- {file = "pandas-2.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:86f100b3876b8c6d1a2c66207288ead435dc71041ee4aea789e55ef0e06408cb"},
1651
- {file = "pandas-2.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:28f330845ad21c11db51e02d8d69acc9035edfd1116926ff7245c7215db57957"},
1652
- {file = "pandas-2.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b9a6ccf0963db88f9b12df6720e55f337447aea217f426a22d71f4213a3099a6"},
1653
- {file = "pandas-2.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d99e678180bc59b0c9443314297bddce4ad35727a1a2656dbe585fd78710b3b9"},
1654
- {file = "pandas-2.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:b31da36d376d50a1a492efb18097b9101bdbd8b3fbb3f49006e02d4495d4c644"},
1655
- {file = "pandas-2.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:0164b85937707ec7f70b34a6c3a578dbf0f50787f910f21ca3b26a7fd3363437"},
1656
- {file = "pandas-2.1.0.tar.gz", hash = "sha256:62c24c7fc59e42b775ce0679cfa7b14a5f9bfb7643cfbe708c960699e05fb918"},
1657
- ]
1658
-
1659
- [package.dependencies]
1660
- numpy = {version = ">=1.23.2", markers = "python_version >= \"3.11\""}
1661
- python-dateutil = ">=2.8.2"
1662
- pytz = ">=2020.1"
1663
- tzdata = ">=2022.1"
1664
-
1665
- [package.extras]
1666
- all = ["PyQt5 (>=5.15.6)", "SQLAlchemy (>=1.4.36)", "beautifulsoup4 (>=4.11.1)", "bottleneck (>=1.3.4)", "dataframe-api-compat (>=0.1.7)", "fastparquet (>=0.8.1)", "fsspec (>=2022.05.0)", "gcsfs (>=2022.05.0)", "html5lib (>=1.1)", "hypothesis (>=6.46.1)", "jinja2 (>=3.1.2)", "lxml (>=4.8.0)", "matplotlib (>=3.6.1)", "numba (>=0.55.2)", "numexpr (>=2.8.0)", "odfpy (>=1.4.1)", "openpyxl (>=3.0.10)", "pandas-gbq (>=0.17.5)", "psycopg2 (>=2.9.3)", "pyarrow (>=7.0.0)", "pymysql (>=1.0.2)", "pyreadstat (>=1.1.5)", "pytest (>=7.3.2)", "pytest-asyncio (>=0.17.0)", "pytest-xdist (>=2.2.0)", "pyxlsb (>=1.0.9)", "qtpy (>=2.2.0)", "s3fs (>=2022.05.0)", "scipy (>=1.8.1)", "tables (>=3.7.0)", "tabulate (>=0.8.10)", "xarray (>=2022.03.0)", "xlrd (>=2.0.1)", "xlsxwriter (>=3.0.3)", "zstandard (>=0.17.0)"]
1667
- aws = ["s3fs (>=2022.05.0)"]
1668
- clipboard = ["PyQt5 (>=5.15.6)", "qtpy (>=2.2.0)"]
1669
- compression = ["zstandard (>=0.17.0)"]
1670
- computation = ["scipy (>=1.8.1)", "xarray (>=2022.03.0)"]
1671
- consortium-standard = ["dataframe-api-compat (>=0.1.7)"]
1672
- excel = ["odfpy (>=1.4.1)", "openpyxl (>=3.0.10)", "pyxlsb (>=1.0.9)", "xlrd (>=2.0.1)", "xlsxwriter (>=3.0.3)"]
1673
- feather = ["pyarrow (>=7.0.0)"]
1674
- fss = ["fsspec (>=2022.05.0)"]
1675
- gcp = ["gcsfs (>=2022.05.0)", "pandas-gbq (>=0.17.5)"]
1676
- hdf5 = ["tables (>=3.7.0)"]
1677
- html = ["beautifulsoup4 (>=4.11.1)", "html5lib (>=1.1)", "lxml (>=4.8.0)"]
1678
- mysql = ["SQLAlchemy (>=1.4.36)", "pymysql (>=1.0.2)"]
1679
- output-formatting = ["jinja2 (>=3.1.2)", "tabulate (>=0.8.10)"]
1680
- parquet = ["pyarrow (>=7.0.0)"]
1681
- performance = ["bottleneck (>=1.3.4)", "numba (>=0.55.2)", "numexpr (>=2.8.0)"]
1682
- plot = ["matplotlib (>=3.6.1)"]
1683
- postgresql = ["SQLAlchemy (>=1.4.36)", "psycopg2 (>=2.9.3)"]
1684
- spss = ["pyreadstat (>=1.1.5)"]
1685
- sql-other = ["SQLAlchemy (>=1.4.36)"]
1686
- test = ["hypothesis (>=6.46.1)", "pytest (>=7.3.2)", "pytest-asyncio (>=0.17.0)", "pytest-xdist (>=2.2.0)"]
1687
- xml = ["lxml (>=4.8.0)"]
1688
-
1689
  [[package]]
1690
  name = "pandas"
1691
  version = "2.2.1"
@@ -1725,10 +1666,7 @@ files = [
1725
  ]
1726
 
1727
  [package.dependencies]
1728
- numpy = [
1729
- {version = ">=1.23.2,<2", markers = "python_version == \"3.11\""},
1730
- {version = ">=1.22.4,<2", markers = "python_version < \"3.11\""},
1731
- ]
1732
  python-dateutil = ">=2.8.2"
1733
  pytz = ">=2020.1"
1734
  tzdata = ">=2022.7"
@@ -3390,5 +3328,5 @@ files = [
3390
 
3391
  [metadata]
3392
  lock-version = "2.0"
3393
- python-versions = "^3.10"
3394
- content-hash = "6096f9305807d46a5fb3c516b50c91a33e83062acf97d80109116cd3c8cdcf33"
 
1553
 
1554
  [package.dependencies]
1555
  numpy = [
1556
+ {version = ">=1.21.4", markers = "python_version >= \"3.10\" and platform_system == \"Darwin\""},
1557
+ {version = ">=1.21.2", markers = "platform_system != \"Darwin\" and python_version >= \"3.10\""},
 
1558
  ]
1559
 
1560
  [[package]]
 
1627
  {file = "packaging-24.0.tar.gz", hash = "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9"},
1628
  ]
1629
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1630
  [[package]]
1631
  name = "pandas"
1632
  version = "2.2.1"
 
1666
  ]
1667
 
1668
  [package.dependencies]
1669
+ numpy = {version = ">=1.22.4,<2", markers = "python_version < \"3.11\""}
 
 
 
1670
  python-dateutil = ">=2.8.2"
1671
  pytz = ">=2020.1"
1672
  tzdata = ">=2022.7"
 
3328
 
3329
  [metadata]
3330
  lock-version = "2.0"
3331
+ python-versions = "~3.10"
3332
+ content-hash = "064f7f0f5756fc1e466cb695b25836f8454a01660c47c7e70189345ee75ab743"
pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
  [tool.poetry]
2
  name = "lisa-on-cuda"
3
- version = "1.0.0"
4
  description = ""
5
  authors = ["alessandro trinca tornidor <[email protected]>"]
6
  license = "Apache 2.0"
@@ -8,10 +8,10 @@ readme = "README.md"
8
 
9
  [metadata]
10
  name = "lisa-on-cuda"
11
- version = "1.0.0"
12
 
13
  [tool.poetry.dependencies]
14
- python = "^3.10"
15
  einops = "^0.7.0"
16
  fastapi = "^0.110.0"
17
  gradio = "^4.21.0"
 
1
  [tool.poetry]
2
  name = "lisa-on-cuda"
3
+ version = "1.0.2"
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.2"
12
 
13
  [tool.poetry.dependencies]
14
+ python = "~3.10"
15
  einops = "^0.7.0"
16
  fastapi = "^0.110.0"
17
  gradio = "^4.21.0"