ovi054 commited on
Commit
643466f
1 Parent(s): f0e7142

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -2,6 +2,9 @@ import torch
2
  from PIL import Image
3
  from transformers import AutoProcessor, AutoModelForCausalLM
4
 
 
 
 
5
  # Initialize Florence model
6
  device = "cuda" if torch.cuda.is_available() else "cpu"
7
  florence_model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-base', trust_remote_code=True).to(device).eval()
 
2
  from PIL import Image
3
  from transformers import AutoProcessor, AutoModelForCausalLM
4
 
5
+
6
+ subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
7
+
8
  # Initialize Florence model
9
  device = "cuda" if torch.cuda.is_available() else "cpu"
10
  florence_model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-base', trust_remote_code=True).to(device).eval()