Spaces:
Running
Running
alessandro trinca tornidor
commited on
Commit
•
cff759e
1
Parent(s):
d1e187e
doc: update README.md
Browse files
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title: SamGIS - LISA on
|
3 |
emoji: 🗺️
|
4 |
colorFrom: red
|
5 |
colorTo: blue
|
@@ -14,8 +14,34 @@ license: mit
|
|
14 |
|
15 |
[LISA](https://github.com/dvlab-research/LISA) (Reasoning Segmentation via Large Language Model) applied to geospatial data thanks to [SamGIS](https://github.com/trincadev/samgis-be).
|
16 |
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
To change the base relative url for custom frontend add the VITE_PREFIX environment variable, e.g.:
|
20 |
|
|
|
21 |
VITE_PREFIX="/custom-url"
|
|
|
|
1 |
---
|
2 |
+
title: SamGIS - LISA on ZeroGPU
|
3 |
emoji: 🗺️
|
4 |
colorFrom: red
|
5 |
colorTo: blue
|
|
|
14 |
|
15 |
[LISA](https://github.com/dvlab-research/LISA) (Reasoning Segmentation via Large Language Model) applied to geospatial data thanks to [SamGIS](https://github.com/trincadev/samgis-be).
|
16 |
|
17 |
+
I also adapted LISA to HuggingFace [lisa-on-cuda](https://huggingface.co/spaces/aletrn/lisa-on-cuda) ZeroGPU space.
|
18 |
+
|
19 |
+
## Custom environment variables for HuggingFace ZeroGPU Space
|
20 |
+
|
21 |
+
Fundamental environment variables you need are:
|
22 |
+
|
23 |
+
```bash
|
24 |
+
XDG_CACHE_HOME="/data/.cache"
|
25 |
+
PROJECT_ROOT_FOLDER="/home/user/app"
|
26 |
+
WORKDIR="/home/user/app"
|
27 |
+
```
|
28 |
+
|
29 |
+
Derived ones:
|
30 |
+
|
31 |
+
```bash
|
32 |
+
MPLCONFIGDIR="/data/.cache/matplotlib"
|
33 |
+
TRANSFORMERS_CACHE="/data/.cache/transformers"
|
34 |
+
PYTORCH_KERNEL_CACHE_PATH="/data/.cache/torch/kernels"
|
35 |
+
FASTAPI_STATIC="/home/user/app/static"
|
36 |
+
VIS_OUTPUT="/home/user/app/vis_output"
|
37 |
+
MODEL_FOLDER="/home/user/app/machine_learning_models"
|
38 |
+
FOLDERS_MAP='{"WORKDIR":"/home/user/app","XDG_CACHE_HOME":"/data/.cache","PROJECT_ROOT_FOLDER":"/home/user/app","MPLCONFIGDIR":"/data/.cache/matplotlib","TRANSFORMERS_CACHE":"/data/.cache/transformers","PYTORCH_KERNEL_CACHE_PATH":"/data/.cache/torch/kernels","FASTAPI_STATIC":"/home/user/app/static","VIS_OUTPUT":"/home/user/app/vis_output"}'
|
39 |
+
```
|
40 |
+
|
41 |
+
The function `build_frontend()` from lisa_on_cuda package create all the folders required for this project using the environment variable `FOLDERS_MAP`. That's useful for cache folders (XDG_CACHE_HOME, MPLCONFIGDIR, TRANSFORMERS_CACHE, PYTORCH_KERNEL_CACHE_PATH) because missing these can slow down the inference process. Also you could keep these folders in a permanent storage disk mounted on a custom path.
|
42 |
|
43 |
To change the base relative url for custom frontend add the VITE_PREFIX environment variable, e.g.:
|
44 |
|
45 |
+
```bash
|
46 |
VITE_PREFIX="/custom-url"
|
47 |
+
```
|