fffiloni commited on
Commit
fffb44f
·
verified ·
1 Parent(s): c685bc8

Update app_wip.py

Browse files
Files changed (1) hide show
  1. app_wip.py +25 -0
app_wip.py CHANGED
@@ -1,3 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from huggingface_hub import snapshot_download
2
 
3
  snapshot_download(
 
1
+ import sys
2
+ import subprocess
3
+
4
+ def ensure_flash_attn():
5
+ try:
6
+ import flash_attn # noqa: F401
7
+ print("[init] flash-attn déjà installé")
8
+ except Exception as e:
9
+ print("[init] Installation de flash-attn (build from source)...", e, flush=True)
10
+ subprocess.run(
11
+ [
12
+ sys.executable,
13
+ "-m",
14
+ "pip",
15
+ "install",
16
+ "flash-attn==2.7.4.post1",
17
+ "--no-build-isolation",
18
+ ],
19
+ check=True,
20
+ )
21
+ import flash_attn # noqa: F401
22
+ print("[init] flash-attn OK")
23
+
24
+ ensure_flash_attn()
25
+
26
  from huggingface_hub import snapshot_download
27
 
28
  snapshot_download(