alessandro trinca tornidor
commited on
Commit
·
05528cb
1
Parent(s):
8f287b5
feat: revert use of spaces.GPU on infer_lisa_gradio()
Browse files
app.py
CHANGED
@@ -55,7 +55,7 @@ async def request_middleware(request, call_next):
|
|
55 |
|
56 |
return await logging_middleware(request, call_next)
|
57 |
|
58 |
-
|
59 |
def gpu_initialization() -> None:
|
60 |
app_logger.info("GPU initialization...")
|
61 |
|
@@ -120,7 +120,10 @@ async def health() -> JSONResponse:
|
|
120 |
return JSONResponse(status_code=200, content={"msg": "still alive..."})
|
121 |
|
122 |
|
123 |
-
#
|
|
|
|
|
|
|
124 |
def infer_lisa_gradio(request_input: StringPromptApiRequestBody) -> str:
|
125 |
from samgis_lisa.io_package.wrappers_helpers import get_parsed_bbox_points_with_string_prompt
|
126 |
from samgis_lisa.prediction_api import lisa
|
|
|
55 |
|
56 |
return await logging_middleware(request, call_next)
|
57 |
|
58 |
+
@spaces.GPU
|
59 |
def gpu_initialization() -> None:
|
60 |
app_logger.info("GPU initialization...")
|
61 |
|
|
|
120 |
return JSONResponse(status_code=200, content={"msg": "still alive..."})
|
121 |
|
122 |
|
123 |
+
# try executing gpu_initialization() not within infer_lisa_gradio()
|
124 |
+
# gpu_initialization()
|
125 |
+
|
126 |
+
@spaces.GPU
|
127 |
def infer_lisa_gradio(request_input: StringPromptApiRequestBody) -> str:
|
128 |
from samgis_lisa.io_package.wrappers_helpers import get_parsed_bbox_points_with_string_prompt
|
129 |
from samgis_lisa.prediction_api import lisa
|