andito HF staff commited on
Commit
0a651e1
·
verified ·
1 Parent(s): b5d8c52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -6,14 +6,15 @@ from PIL import Image
6
  import torch
7
  import spaces
8
  import subprocess
9
- subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
10
 
11
 
12
  processor = AutoProcessor.from_pretrained("HuggingFaceTB/SmolVLM_converted_4")
13
 
14
  model = Idefics3ForConditionalGeneration.from_pretrained("HuggingFaceTB/SmolVLM_converted_4",
15
  torch_dtype=torch.bfloat16,
16
- _attn_implementation="flash_attention_2").to("cuda")
 
17
 
18
  @spaces.GPU
19
  def model_inference(
 
6
  import torch
7
  import spaces
8
  import subprocess
9
+ #subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
10
 
11
 
12
  processor = AutoProcessor.from_pretrained("HuggingFaceTB/SmolVLM_converted_4")
13
 
14
  model = Idefics3ForConditionalGeneration.from_pretrained("HuggingFaceTB/SmolVLM_converted_4",
15
  torch_dtype=torch.bfloat16,
16
+ #_attn_implementation="flash_attention_2"
17
+ ).to("cuda")
18
 
19
  @spaces.GPU
20
  def model_inference(