Spaces:
Running on Zero
Running on Zero
Drop hub kernels (no speedup); 90s GPU chunks
Browse files- app.py +1 -8
- requirements.txt +1 -2
app.py
CHANGED
|
@@ -158,15 +158,8 @@ END_TOKENS = ("<|im_end|>", "<|endoftext|>")
|
|
| 158 |
processor = AutoProcessor.from_pretrained(MODEL_ID)
|
| 159 |
tokenizer = processor.tokenizer
|
| 160 |
model = AutoModelForImageTextToText.from_pretrained(MODEL_ID, dtype=torch.bfloat16).to("cuda").eval()
|
| 161 |
-
try: # Hub kernels (causal-conv1d, fused norms/activations) for faster decoding; the eager model works without them
|
| 162 |
-
from kernels import Mode
|
| 163 |
|
| 164 |
-
|
| 165 |
-
print("hub kernels enabled")
|
| 166 |
-
except Exception as e:
|
| 167 |
-
print(f"hub kernels unavailable ({type(e).__name__}: {e}); using the eager PyTorch paths")
|
| 168 |
-
|
| 169 |
-
GPU_CHUNK_SECONDS = 100 # one GPU call generates for at most this long; long turns continue in the next call
|
| 170 |
|
| 171 |
|
| 172 |
@spaces.GPU(duration=120)
|
|
|
|
| 158 |
processor = AutoProcessor.from_pretrained(MODEL_ID)
|
| 159 |
tokenizer = processor.tokenizer
|
| 160 |
model = AutoModelForImageTextToText.from_pretrained(MODEL_ID, dtype=torch.bfloat16).to("cuda").eval()
|
|
|
|
|
|
|
| 161 |
|
| 162 |
+
GPU_CHUNK_SECONDS = 90 # one GPU call generates for at most this long; long turns continue in the next call
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
|
| 164 |
|
| 165 |
@spaces.GPU(duration=120)
|
requirements.txt
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
-
transformers=
|
| 2 |
-
kernels>=0.17.2,<0.18
|
| 3 |
torchvision
|
| 4 |
accelerate
|
| 5 |
flash-linear-attention
|
|
|
|
| 1 |
+
transformers>=5.17.0
|
|
|
|
| 2 |
torchvision
|
| 3 |
accelerate
|
| 4 |
flash-linear-attention
|