Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -336,13 +336,13 @@ else:
|
|
336 |
@spaces.GPU(duration=90)
|
337 |
def run_autoforge_process(cmd, log_path):
|
338 |
"""Run AutoForge in-process and stream its console output to *log_path*."""
|
339 |
-
|
340 |
cli_args = cmd[1:] # skip the literal "autoforge"
|
341 |
autoforge_main = importlib.import_module("autoforge.__main__")
|
342 |
|
343 |
exit_code = 0
|
344 |
with open(log_path, "w", buffering=1, encoding="utf-8") as log_f, \
|
345 |
-
redirect_stdout(log_f), redirect_stderr(log_f):
|
346 |
try:
|
347 |
sys.argv = ["autoforge"] + cli_args
|
348 |
autoforge_main.main() # runs until completion
|
@@ -684,10 +684,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
684 |
def execute_autoforge_script(
|
685 |
current_filaments_df_state_val, input_image, *accordion_param_values
|
686 |
):
|
687 |
-
|
688 |
-
from joblib import parallel_backend
|
689 |
-
parallel_backend("threading").install()
|
690 |
-
|
691 |
log_output = []
|
692 |
|
693 |
# 0. Validate Inputs
|
|
|
336 |
@spaces.GPU(duration=90)
|
337 |
def run_autoforge_process(cmd, log_path):
|
338 |
"""Run AutoForge in-process and stream its console output to *log_path*."""
|
339 |
+
from joblib import parallel_backend
|
340 |
cli_args = cmd[1:] # skip the literal "autoforge"
|
341 |
autoforge_main = importlib.import_module("autoforge.__main__")
|
342 |
|
343 |
exit_code = 0
|
344 |
with open(log_path, "w", buffering=1, encoding="utf-8") as log_f, \
|
345 |
+
redirect_stdout(log_f), redirect_stderr(log_f), parallel_backend("threading", n_jobs=-1):
|
346 |
try:
|
347 |
sys.argv = ["autoforge"] + cli_args
|
348 |
autoforge_main.main() # runs until completion
|
|
|
684 |
def execute_autoforge_script(
|
685 |
current_filaments_df_state_val, input_image, *accordion_param_values
|
686 |
):
|
687 |
+
|
|
|
|
|
|
|
688 |
log_output = []
|
689 |
|
690 |
# 0. Validate Inputs
|