Spaces:
Paused
Paused
alessandro trinca tornidor
commited on
Commit
·
656fa96
1
Parent(s):
e35418a
feat: add device_map argument to try avoid CUDA init RuntimeError, bump lisa-on-cuda to version 1.4.6
Browse files- lisa_on_cuda/utils/app_helpers.py +3 -1
- pyproject.toml +2 -2
lisa_on_cuda/utils/app_helpers.py
CHANGED
@@ -224,7 +224,9 @@ def get_model(args_to_parse, internal_logger: logging = None, inference_decorato
|
|
224 |
) if inference_decorator else prepare_model_vision_tower(
|
225 |
_model, args_to_parse, torch_dtype
|
226 |
)
|
227 |
-
|
|
|
|
|
228 |
internal_logger.debug("vision tower loaded, prepare clip image processor...")
|
229 |
_clip_image_processor = CLIPImageProcessor.from_pretrained(_model.config.vision_tower)
|
230 |
internal_logger.debug("clip image processor done.")
|
|
|
224 |
) if inference_decorator else prepare_model_vision_tower(
|
225 |
_model, args_to_parse, torch_dtype
|
226 |
)
|
227 |
+
# set device to device_map try to avoid CUDA init RuntimeError on ZeroGPU huggingface hardware
|
228 |
+
device = device_map if device_map else args_to_parse.local_rank
|
229 |
+
vision_tower.to(device=device)
|
230 |
internal_logger.debug("vision tower loaded, prepare clip image processor...")
|
231 |
_clip_image_processor = CLIPImageProcessor.from_pretrained(_model.config.vision_tower)
|
232 |
internal_logger.debug("clip image processor done.")
|
pyproject.toml
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
[tool.poetry]
|
2 |
name = "lisa-on-cuda"
|
3 |
-
version = "1.4.
|
4 |
description = "LISA (Reasoning Segmentation via Large Language Model) on cuda, now with huggingface ZeroGPU support!"
|
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.4.
|
12 |
|
13 |
[tool.poetry.urls]
|
14 |
Source = "https://huggingface.co/spaces/aletrn/lisa-on-cuda/"
|
|
|
1 |
[tool.poetry]
|
2 |
name = "lisa-on-cuda"
|
3 |
+
version = "1.4.6"
|
4 |
description = "LISA (Reasoning Segmentation via Large Language Model) on cuda, now with huggingface ZeroGPU support!"
|
5 |
authors = ["alessandro trinca tornidor <[email protected]>"]
|
6 |
license = "Apache 2.0"
|
|
|
8 |
|
9 |
[metadata]
|
10 |
name = "lisa-on-cuda"
|
11 |
+
version = "1.4.6"
|
12 |
|
13 |
[tool.poetry.urls]
|
14 |
Source = "https://huggingface.co/spaces/aletrn/lisa-on-cuda/"
|