Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -17,14 +17,14 @@ from PIL import Image
|
|
17 |
from accelerate.utils import set_seed
|
18 |
|
19 |
import subprocess
|
20 |
-
|
21 |
|
22 |
-
#
|
23 |
-
|
24 |
-
|
25 |
|
26 |
-
#
|
27 |
-
|
28 |
|
29 |
# def sh(cmd): subprocess.check_call(cmd, shell=True)
|
30 |
|
@@ -60,8 +60,8 @@ print(f"{header_path} exists:", os.path.exists(header_path))
|
|
60 |
subprocess.run(["pip", "install","diso"], check=True)
|
61 |
|
62 |
|
63 |
-
#
|
64 |
-
|
65 |
|
66 |
|
67 |
from src.utils.data_utils import get_colored_mesh_composition, scene_to_parts, load_surfaces
|
|
|
17 |
from accelerate.utils import set_seed
|
18 |
|
19 |
import subprocess
|
20 |
+
import importlib, site, sys
|
21 |
|
22 |
+
# Re-discover all .pth/.egg-link files
|
23 |
+
for sitedir in site.getsitepackages():
|
24 |
+
site.addsitedir(sitedir)
|
25 |
|
26 |
+
# Clear caches so importlib will pick up new modules
|
27 |
+
importlib.invalidate_caches()
|
28 |
|
29 |
# def sh(cmd): subprocess.check_call(cmd, shell=True)
|
30 |
|
|
|
60 |
subprocess.run(["pip", "install","diso"], check=True)
|
61 |
|
62 |
|
63 |
+
# tell Python to re-scan site-packages now that the egg-link exists
|
64 |
+
import importlib, site; site.addsitedir(site.getsitepackages()[0]); importlib.invalidate_caches()
|
65 |
|
66 |
|
67 |
from src.utils.data_utils import get_colored_mesh_composition, scene_to_parts, load_surfaces
|