Update app.py
Browse files
app.py
CHANGED
@@ -5,16 +5,8 @@ import spaces
|
|
5 |
import io
|
6 |
from PIL import Image
|
7 |
import subprocess
|
8 |
-
|
9 |
-
|
10 |
-
# Atualizar pip
|
11 |
-
subprocess.run(['pip', 'install', '--upgrade', 'pip'], check=True)
|
12 |
-
|
13 |
-
# Instalar packaging globalmente
|
14 |
-
subprocess.run(['pip', 'install', 'packaging'], check=True)
|
15 |
|
16 |
-
# Tente instalar einops e flash_attn novamente
|
17 |
-
subprocess.run(['pip', 'install', 'einops', 'flash_attn'], check=True)
|
18 |
model_id = 'J-LAB/Florence_2_L_FluxiAI_Product_Caption'
|
19 |
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True).to("cuda").eval()
|
20 |
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
|
|
|
5 |
import io
|
6 |
from PIL import Image
|
7 |
import subprocess
|
8 |
+
subprocess.run('pip' 'install' 'flash-attn' '--no-build-isolation', check=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
|
|
|
|
10 |
model_id = 'J-LAB/Florence_2_L_FluxiAI_Product_Caption'
|
11 |
model = AutoModelForCausalLM.from_pretrained(model_id, trust_remote_code=True).to("cuda").eval()
|
12 |
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
|