Spaces:
BAAI
/
Running on L40S

ryanzhangfan commited on
Commit
6375423
1 Parent(s): 45273a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -16,6 +16,14 @@ import torch
16
  from emu3.mllm.processing_emu3 import Emu3Processor
17
  import spaces
18
 
 
 
 
 
 
 
 
 
19
  # Model paths
20
  EMU_GEN_HUB = "BAAI/Emu3-Gen"
21
  EMU_CHAT_HUB = "BAAI/Emu3-Chat"
 
16
  from emu3.mllm.processing_emu3 import Emu3Processor
17
  import spaces
18
 
19
+ import subprocess
20
+ # Install flash attention, skipping CUDA build if necessary
21
+ subprocess.run(
22
+ "pip install flash-attn --no-build-isolation",
23
+ env={"FLASH_ATTENTION_SKIP_CUDA_BUILD": "TRUE"},
24
+ shell=True,
25
+ )
26
+
27
  # Model paths
28
  EMU_GEN_HUB = "BAAI/Emu3-Gen"
29
  EMU_CHAT_HUB = "BAAI/Emu3-Chat"