Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,9 @@ import os
|
|
6 |
import numpy as np
|
7 |
import spaces
|
8 |
|
|
|
|
|
|
|
9 |
model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True).to("cuda").eval()
|
10 |
processor = AutoProcessor.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True)
|
11 |
|
|
|
6 |
import numpy as np
|
7 |
import spaces
|
8 |
|
9 |
+
import subprocess
|
10 |
+
subprocess.run('pip install flash-attn --no-build-isolation', env={'FLASH_ATTENTION_SKIP_CUDA_BUILD': "TRUE"}, shell=True)
|
11 |
+
|
12 |
model = AutoModelForCausalLM.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True).to("cuda").eval()
|
13 |
processor = AutoProcessor.from_pretrained('microsoft/Florence-2-large', trust_remote_code=True)
|
14 |
|