Spaces:
Running on Zero
Running on Zero
Isolate GTE startup packing from completed 0.6B model
Browse files- __pycache__/app.cpython-313.pyc +0 -0
- app.py +6 -5
__pycache__/app.cpython-313.pyc
CHANGED
|
Binary files a/__pycache__/app.cpython-313.pyc and b/__pycache__/app.cpython-313.pyc differ
|
|
|
app.py
CHANGED
|
@@ -27,11 +27,10 @@ TASK = (
|
|
| 27 |
|
| 28 |
|
| 29 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH, padding_side="left")
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
).to("cuda").eval()
|
| 35 |
|
| 36 |
# ZeroGPU optimizes CUDA placements made during module startup. The previous
|
| 37 |
# larger-family path loaded this model inside the decorated call and exhausted
|
|
@@ -90,6 +89,8 @@ def retrieval_metrics(queries: np.ndarray, documents: np.ndarray) -> tuple[dict,
|
|
| 90 |
|
| 91 |
@spaces.GPU(duration=300)
|
| 92 |
def run_bf16_control() -> dict:
|
|
|
|
|
|
|
| 93 |
pairs = json.loads(INPUT_PATH.read_text())
|
| 94 |
query_texts = [detailed_instruction(item["query"]) for item in pairs]
|
| 95 |
document_texts = [item["document"] for item in pairs]
|
|
|
|
| 27 |
|
| 28 |
|
| 29 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH, padding_side="left")
|
| 30 |
+
# The completed 0.6B phase is intentionally not resident while the larger GTE
|
| 31 |
+
# startup path is validated. Packing both models together exceeded the
|
| 32 |
+
# current Space startup envelope at 6.16 GB.
|
| 33 |
+
model = None
|
|
|
|
| 34 |
|
| 35 |
# ZeroGPU optimizes CUDA placements made during module startup. The previous
|
| 36 |
# larger-family path loaded this model inside the decorated call and exhausted
|
|
|
|
| 89 |
|
| 90 |
@spaces.GPU(duration=300)
|
| 91 |
def run_bf16_control() -> dict:
|
| 92 |
+
if model is None:
|
| 93 |
+
raise RuntimeError("0.6B BF16 control is offline during the GTE phase")
|
| 94 |
pairs = json.loads(INPUT_PATH.read_text())
|
| 95 |
query_texts = [detailed_instruction(item["query"]) for item in pairs]
|
| 96 |
document_texts = [item["document"] for item in pairs]
|