Spaces:
Sleeping
Sleeping
debug
Browse files
app.py
CHANGED
|
@@ -9,6 +9,7 @@ def run(cmd, cwd=None):
|
|
| 9 |
subprocess.check_call(cmd, shell=True, cwd=cwd)
|
| 10 |
|
| 11 |
def setup_deps():
|
|
|
|
| 12 |
# Use a flag to prevent infinite restarts
|
| 13 |
if os.environ.get("HF_SPACE_BOOTSTRAPPED") == "1":
|
| 14 |
return
|
|
@@ -26,6 +27,7 @@ def setup_deps():
|
|
| 26 |
run("pip install torch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 --index-url https://download.pytorch.org/whl/cpu")
|
| 27 |
run("pip install -e .", cwd="segment-anything-2")
|
| 28 |
run("pip install --no-deps -r requirements_manual.txt")
|
|
|
|
| 29 |
|
| 30 |
# Relaunch the script with an env flag to avoid looping
|
| 31 |
print("♻️ Restarting app to apply changes...")
|
|
|
|
| 9 |
subprocess.check_call(cmd, shell=True, cwd=cwd)
|
| 10 |
|
| 11 |
def setup_deps():
|
| 12 |
+
print(f"mouse_yolo.pt size: {os.path.getsize('checkpoints/mouse_yolo.pt')} bytes")
|
| 13 |
# Use a flag to prevent infinite restarts
|
| 14 |
if os.environ.get("HF_SPACE_BOOTSTRAPPED") == "1":
|
| 15 |
return
|
|
|
|
| 27 |
run("pip install torch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 --index-url https://download.pytorch.org/whl/cpu")
|
| 28 |
run("pip install -e .", cwd="segment-anything-2")
|
| 29 |
run("pip install --no-deps -r requirements_manual.txt")
|
| 30 |
+
run("git lfs install && git lfs pull", cwd=".") # assuming checkpoints/mouse_yolo.pt is tracked
|
| 31 |
|
| 32 |
# Relaunch the script with an env flag to avoid looping
|
| 33 |
print("♻️ Restarting app to apply changes...")
|