Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -41,7 +41,9 @@ processor = AudioFlamingo3TemporalProcessor.from_pretrained(BASE_MODEL)
|
|
| 41 |
model = AudioFlamingo3ForTemporalConditionalGeneration.from_pretrained(
|
| 42 |
BASE_MODEL, dtype=torch.bfloat16, attn_implementation="sdpa"
|
| 43 |
)
|
| 44 |
-
|
|
|
|
|
|
|
| 45 |
model = model.eval().to("cuda")
|
| 46 |
|
| 47 |
# ------------------------------------------------------------- utilities -----
|
|
|
|
| 41 |
model = AudioFlamingo3ForTemporalConditionalGeneration.from_pretrained(
|
| 42 |
BASE_MODEL, dtype=torch.bfloat16, attn_implementation="sdpa"
|
| 43 |
)
|
| 44 |
+
# `torch_device="cpu"`: peft otherwise infers "cuda" and safetensors would try to
|
| 45 |
+
# materialise the adapter on a GPU that does not exist yet under ZeroGPU.
|
| 46 |
+
model = PeftModel.from_pretrained(model, ADAPTER, torch_device="cpu").merge_and_unload()
|
| 47 |
model = model.eval().to("cuda")
|
| 48 |
|
| 49 |
# ------------------------------------------------------------- utilities -----
|