Update app.py
Browse files
app.py
CHANGED
@@ -5,19 +5,27 @@ import argparse
|
|
5 |
import os
|
6 |
import urllib.request
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
21 |
|
22 |
from wfd.webui import start_demo
|
23 |
class Arguments:
|
|
|
5 |
import os
|
6 |
import urllib.request
|
7 |
|
8 |
+
def fix_file(path):
|
9 |
+
# I think this is because I did the setup.py wrong, but pip install git+repo works in colab so idk how to really fix
|
10 |
+
target_path = "/home/user/.local/lib/python3.8/site-packages/wfd/{}".format(path)
|
11 |
+
if not os.path.exists(target_path):
|
12 |
+
try:
|
13 |
+
os.makedirs("/home/user/.local/lib/python3.8/site-packages/wfd/{}".format(os.path.dirname(path)))
|
14 |
+
except Exception as e:
|
15 |
+
print(e)
|
16 |
+
try:
|
17 |
+
urllib.request.urlretrieve(
|
18 |
+
"https://github.com/wdcqc/WaveFunctionDiffusion/raw/remaster/wfd/{}".format(path),
|
19 |
+
target_path
|
20 |
+
)
|
21 |
+
except Exception as e:
|
22 |
+
print(e)
|
23 |
|
24 |
+
if __name__ == "__main__":
|
25 |
+
fix_file("mpqapi/libstorm.so")
|
26 |
+
fix_file("webui/templates/tempura.css")
|
27 |
+
fix_file("webui/templates/background.css")
|
28 |
+
fix_file("webui/doki_settings.json")
|
29 |
|
30 |
from wfd.webui import start_demo
|
31 |
class Arguments:
|