Spaces:
Running
Running
Update app.py
Browse files
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()
|