multimodalart HF Staff commited on
Commit
1231ddb
·
verified ·
1 Parent(s): 2977eaa

Drop hub kernels (no speedup); 90s GPU chunks

Browse files
Files changed (2) hide show
  1. app.py +1 -8
  2. 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
- model.set_use_kernels(True, mode=Mode.INFERENCE)
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==5.22.2
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