Spaces:
Sleeping
Sleeping
fix error
Browse files- generate.py +7 -7
generate.py
CHANGED
@@ -62,12 +62,12 @@ opts.streamlit = True
|
|
62 |
# [(90, 'ษ'), (91, 'ส'), (92, 'ห'), (93, 'ฬ'), (94, 'อ')]
|
63 |
# [(95, 'ฮ')]
|
64 |
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
|
72 |
import string
|
73 |
|
@@ -91,7 +91,7 @@ def preprocessing(ttf_file) -> str:
|
|
91 |
if os.path.exists(opts.data_path):
|
92 |
shutil.rmtree(opts.data_path) # Remove Inference Folder
|
93 |
for directory in directories:
|
94 |
-
os.makedirs(os.path.join(
|
95 |
|
96 |
# Save File / Copy File
|
97 |
if isinstance(ttf_file, memoryview):
|
|
|
62 |
# [(90, 'ษ'), (91, 'ส'), (92, 'ห'), (93, 'ฬ'), (94, 'อ')]
|
63 |
# [(95, 'ฮ')]
|
64 |
|
65 |
+
ON_PRODUCTION = True
|
66 |
+
if ON_PRODUCTION:
|
67 |
+
start_path = os.getcwd()
|
68 |
+
opts.data_path = os.path.join(start_path, "inference")
|
69 |
+
else:
|
70 |
+
start_path = ""
|
71 |
|
72 |
import string
|
73 |
|
|
|
91 |
if os.path.exists(opts.data_path):
|
92 |
shutil.rmtree(opts.data_path) # Remove Inference Folder
|
93 |
for directory in directories:
|
94 |
+
os.makedirs(os.path.join(start_path, directory), exist_ok=True)
|
95 |
|
96 |
# Save File / Copy File
|
97 |
if isinstance(ttf_file, memoryview):
|