From dbf1ed08548ce91303ccec42cdc98b497f5e3b68 Mon Sep 17 00:00:00 2001 From: Kyle McLaren Date: Wed, 3 Jul 2024 22:16:08 +0200 Subject: [PATCH] =?UTF-8?q?Lazy=20load=20weights=20=E2=80=94=20we=20don't?= =?UTF-8?q?=20need=20a=20start=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fly.toml | 6 +----- predict.py | 2 +- start.sh | 10 ---------- 3 files changed, 2 insertions(+), 16 deletions(-) delete mode 100755 start.sh diff --git a/fly.toml b/fly.toml index 4e6e097..8aeebaf 100644 --- a/fly.toml +++ b/fly.toml @@ -4,7 +4,7 @@ image = "ghcr.io/fly-apps/cog-whisper:latest" [experimental] - cmd = ["./start.sh"] + cmd = ["python -m cog.server.http"] [env] COG_LOG_LEVEL = "debug" @@ -33,7 +33,3 @@ source = 'data' destination = '/src/weights' initial_size = '10G' - -[[files]] - guest_path = "/src/start.sh" - local_path = "./start.sh" diff --git a/predict.py b/predict.py index 2ebec5f..6d9ea1a 100644 --- a/predict.py +++ b/predict.py @@ -11,7 +11,7 @@ from whisper.utils import format_timestamp MODEL_CACHE = "weights" -BASE_URL = f"https://weights.replicate.delivery/default/whisper-v3/{MODEL_CACHE}/" +BASE_URL = f"https://fly.storage.tigris.dev/weights/models/whisper/" class ModelOutput(BaseModel): diff --git a/start.sh b/start.sh deleted file mode 100755 index a1b5523..0000000 --- a/start.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -if [ -f /src/weights/large-v3.pt ] -then - echo "Weights already exist" -else - /src/scripts/get_weights.sh -fi - -python -m cog.server.http