Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -101,20 +101,6 @@ def exc_text(exc: BaseException) -> str:
|
|
| 101 |
return " ".join(str(a) for a in exc.args).strip()
|
| 102 |
return exc.__class__.__name__
|
| 103 |
|
| 104 |
-
def _check_quota(required_sec: int):
|
| 105 |
-
"""
|
| 106 |
-
Check if the user has enough ZeroGPU quota remaining.
|
| 107 |
-
Raises RuntimeError if not enough.
|
| 108 |
-
"""
|
| 109 |
-
remaining = int(os.getenv("ZEROGPU_REMAINING", "0"))
|
| 110 |
-
print(os.environ)
|
| 111 |
-
if remaining < required_sec:
|
| 112 |
-
raise RuntimeError(
|
| 113 |
-
f"Insufficient ZeroGPU quota: need {required_sec}s but only {remaining}s left.\n"
|
| 114 |
-
"Please log in to Hugging Face or wait a few minutes for quota to recharge."
|
| 115 |
-
)
|
| 116 |
-
|
| 117 |
-
|
| 118 |
def ensure_required_cols(df, *, in_display_space):
|
| 119 |
"""
|
| 120 |
Return a copy of *df* with every required column present.
|
|
@@ -349,7 +335,6 @@ else:
|
|
| 349 |
@spaces.GPU(duration=90)
|
| 350 |
def run_autoforge_process(cmd, log_path):
|
| 351 |
"""Run AutoForge in-process and stream its console output to *log_path*."""
|
| 352 |
-
_check_quota(90)
|
| 353 |
|
| 354 |
cli_args = cmd[1:] # skip the literal "autoforge"
|
| 355 |
autoforge_main = importlib.import_module("autoforge.__main__")
|
|
|
|
| 101 |
return " ".join(str(a) for a in exc.args).strip()
|
| 102 |
return exc.__class__.__name__
|
| 103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
def ensure_required_cols(df, *, in_display_space):
|
| 105 |
"""
|
| 106 |
Return a copy of *df* with every required column present.
|
|
|
|
| 335 |
@spaces.GPU(duration=90)
|
| 336 |
def run_autoforge_process(cmd, log_path):
|
| 337 |
"""Run AutoForge in-process and stream its console output to *log_path*."""
|
|
|
|
| 338 |
|
| 339 |
cli_args = cmd[1:] # skip the literal "autoforge"
|
| 340 |
autoforge_main = importlib.import_module("autoforge.__main__")
|