Spaces:
Paused
Paused
Upload folder using huggingface_hub
Browse files- README.md +1 -1
- hg_app.py +1 -1
- hg_app_bak.py +11 -22
README.md
CHANGED
@@ -5,7 +5,7 @@ colorFrom: purple
|
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.44.1
|
8 |
-
app_file:
|
9 |
pinned: false
|
10 |
short_description: Text-to-3D and Image-to-3D Generation
|
11 |
---
|
|
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
sdk_version: 4.44.1
|
8 |
+
app_file: hg_app_bak.py
|
9 |
pinned: false
|
10 |
short_description: Text-to-3D and Image-to-3D Generation
|
11 |
---
|
hg_app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
# pip install gradio==4.44.1
|
2 |
-
if
|
3 |
import os
|
4 |
import spaces
|
5 |
import subprocess
|
|
|
1 |
# pip install gradio==4.44.1
|
2 |
+
if False:
|
3 |
import os
|
4 |
import spaces
|
5 |
import subprocess
|
hg_app_bak.py
CHANGED
@@ -3,28 +3,17 @@ if False:
|
|
3 |
import os
|
4 |
import spaces
|
5 |
import subprocess
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
CUDA_TOOLKIT_FILE = "/tmp/%s" % os.path.basename(CUDA_TOOLKIT_URL)
|
10 |
-
subprocess.call(["wget", "-q", CUDA_TOOLKIT_URL, "-O", CUDA_TOOLKIT_FILE])
|
11 |
-
subprocess.call(["chmod", "+x", CUDA_TOOLKIT_FILE])
|
12 |
-
subprocess.call([CUDA_TOOLKIT_FILE, "--silent", "--toolkit"])
|
13 |
-
|
14 |
-
os.environ["CUDA_HOME"] = "/usr/local/cuda"
|
15 |
-
os.environ["PATH"] = "%s/bin:%s" % (os.environ["CUDA_HOME"], os.environ["PATH"])
|
16 |
-
os.environ["LD_LIBRARY_PATH"] = "%s/lib:%s" % (
|
17 |
-
os.environ["CUDA_HOME"],
|
18 |
-
"" if "LD_LIBRARY_PATH" not in os.environ else os.environ["LD_LIBRARY_PATH"],
|
19 |
-
)
|
20 |
-
# Fix: arch_list[-1] += '+PTX'; IndexError: list index out of range
|
21 |
-
os.environ["TORCH_CUDA_ARCH_LIST"] = "8.0;8.6"
|
22 |
-
|
23 |
-
install_cuda_toolkit()
|
24 |
os.system("cd /home/user/app/hy3dgen/texgen/differentiable_renderer/ && bash compile_mesh_painter.sh")
|
25 |
-
|
26 |
-
|
|
|
|
|
27 |
else:
|
|
|
|
|
28 |
class spaces:
|
29 |
class GPU:
|
30 |
def __init__(self, duration=60):
|
@@ -54,7 +43,7 @@ def get_example_txt_list():
|
|
54 |
return txt_list
|
55 |
|
56 |
|
57 |
-
def gen_save_folder(max_size=
|
58 |
os.makedirs(SAVE_DIR, exist_ok=True)
|
59 |
exists = set(int(_) for _ in os.listdir(SAVE_DIR) if not _.startswith("."))
|
60 |
cur_id = min(set(range(max_size)) - exists) if len(exists) < max_size else -1
|
@@ -410,4 +399,4 @@ if __name__ == '__main__':
|
|
410 |
face_reduce_worker = FaceReducer()
|
411 |
|
412 |
demo = build_app()
|
413 |
-
demo.queue().launch()
|
|
|
3 |
import os
|
4 |
import spaces
|
5 |
import subprocess
|
6 |
+
import sys
|
7 |
+
import shlex
|
8 |
+
print("cd /home/user/app/hy3dgen/texgen/differentiable_renderer/ && bash compile_mesh_painter.sh")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
os.system("cd /home/user/app/hy3dgen/texgen/differentiable_renderer/ && bash compile_mesh_painter.sh")
|
10 |
+
print('install custom')
|
11 |
+
subprocess.run(shlex.split("pip install custom_rasterizer-0.1-cp310-cp310-linux_x86_64.whl"), check=True)
|
12 |
+
IP = "0.0.0.0"
|
13 |
+
PORT = 7860
|
14 |
else:
|
15 |
+
IP = "0.0.0.0"
|
16 |
+
PORT = 8080
|
17 |
class spaces:
|
18 |
class GPU:
|
19 |
def __init__(self, duration=60):
|
|
|
43 |
return txt_list
|
44 |
|
45 |
|
46 |
+
def gen_save_folder(max_size=6000):
|
47 |
os.makedirs(SAVE_DIR, exist_ok=True)
|
48 |
exists = set(int(_) for _ in os.listdir(SAVE_DIR) if not _.startswith("."))
|
49 |
cur_id = min(set(range(max_size)) - exists) if len(exists) < max_size else -1
|
|
|
399 |
face_reduce_worker = FaceReducer()
|
400 |
|
401 |
demo = build_app()
|
402 |
+
demo.queue().launch(server_name=IP,server_port=PORT)
|