Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
e6d37b7
1
Parent(s):
83aa561
formatting
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import zipfile
|
|
6 |
|
7 |
import sentry_sdk
|
8 |
import wandb
|
9 |
-
from sentry_sdk import capture_exception
|
10 |
from sentry_sdk.integrations.logging import LoggingIntegration
|
11 |
from sentry_sdk.integrations.starlette import StarletteIntegration
|
12 |
from sentry_sdk.integrations.fastapi import FastApiIntegration
|
@@ -47,8 +47,9 @@ else:
|
|
47 |
|
48 |
|
49 |
|
50 |
-
import gradio
|
51 |
-
|
|
|
52 |
|
53 |
orig_call_fn = gradio.blocks.Blocks.call_function # present in all 3.x & 4.x
|
54 |
|
@@ -70,7 +71,6 @@ import pandas as pd
|
|
70 |
import os
|
71 |
import subprocess
|
72 |
import time
|
73 |
-
import shutil
|
74 |
import sys
|
75 |
from datetime import datetime
|
76 |
import re
|
@@ -328,7 +328,6 @@ def run_autoforge_process(cmd, log_path):
|
|
328 |
All stdout/stderr lines are appended (line-buffered) to *log_path*.
|
329 |
Returns the CLI's exit-code.
|
330 |
"""
|
331 |
-
import subprocess, io, os, sys
|
332 |
|
333 |
with open(log_path, "w", buffering=1, encoding="utf-8") as log_f: # line-buffered
|
334 |
proc = subprocess.Popen(
|
@@ -765,7 +764,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
765 |
|
766 |
# 3. Run script
|
767 |
log_output = [
|
768 |
-
|
769 |
f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n",
|
770 |
f"Output directory: {run_output_dir_val}\n",
|
771 |
f"Command: {' '.join(command)}\n\n",
|
@@ -795,8 +794,6 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
795 |
return src # → refresh image
|
796 |
|
797 |
# ---- run Autoforge on the GPU in a helper thread ------------------
|
798 |
-
from threading import Thread
|
799 |
-
from queue import Queue, Empty
|
800 |
|
801 |
log_file = os.path.join(run_output_dir_val, "autoforge_live.log")
|
802 |
open(log_file, "w", encoding="utf-8").close()
|
|
|
6 |
|
7 |
import sentry_sdk
|
8 |
import wandb
|
9 |
+
from sentry_sdk import capture_exception
|
10 |
from sentry_sdk.integrations.logging import LoggingIntegration
|
11 |
from sentry_sdk.integrations.starlette import StarletteIntegration
|
12 |
from sentry_sdk.integrations.fastapi import FastApiIntegration
|
|
|
47 |
|
48 |
|
49 |
|
50 |
+
import gradio
|
51 |
+
import functools
|
52 |
+
from sentry_sdk import flush
|
53 |
|
54 |
orig_call_fn = gradio.blocks.Blocks.call_function # present in all 3.x & 4.x
|
55 |
|
|
|
71 |
import os
|
72 |
import subprocess
|
73 |
import time
|
|
|
74 |
import sys
|
75 |
from datetime import datetime
|
76 |
import re
|
|
|
328 |
All stdout/stderr lines are appended (line-buffered) to *log_path*.
|
329 |
Returns the CLI's exit-code.
|
330 |
"""
|
|
|
331 |
|
332 |
with open(log_path, "w", buffering=1, encoding="utf-8") as log_f: # line-buffered
|
333 |
proc = subprocess.Popen(
|
|
|
764 |
|
765 |
# 3. Run script
|
766 |
log_output = [
|
767 |
+
"Starting Autoforge process at ",
|
768 |
f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n",
|
769 |
f"Output directory: {run_output_dir_val}\n",
|
770 |
f"Command: {' '.join(command)}\n\n",
|
|
|
794 |
return src # → refresh image
|
795 |
|
796 |
# ---- run Autoforge on the GPU in a helper thread ------------------
|
|
|
|
|
797 |
|
798 |
log_file = os.path.join(run_output_dir_val, "autoforge_live.log")
|
799 |
open(log_file, "w", encoding="utf-8").close()
|