Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -12,6 +12,15 @@ import subprocess
|
|
12 |
|
13 |
#os.system("pip install ./flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp310-cp310-linux_x86_64.whl")
|
14 |
subprocess.check_call([sys.executable, "-m", "pip", "install", "./flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp310-cp310-linux_x86_64.whl"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
model_path = snapshot_download(repo_id="Skywork/UniPic2-Metaquery-9B")
|
17 |
qwen_vl_path = snapshot_download(repo_id="Qwen/Qwen2.5-VL-7B-Instruct-AWQ")
|
|
|
12 |
|
13 |
#os.system("pip install ./flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp310-cp310-linux_x86_64.whl")
|
14 |
subprocess.check_call([sys.executable, "-m", "pip", "install", "./flash_attn-2.7.4.post1+cu12torch2.6cxx11abiFALSE-cp310-cp310-linux_x86_64.whl"])
|
15 |
+
def ensure_flash_attn():
|
16 |
+
try:
|
17 |
+
import flash_attn
|
18 |
+
print("当前 flash-attn 已安装,版本:", flash_attn.__version__)
|
19 |
+
except ImportError:
|
20 |
+
print("未安装 flash-attn,开始安装...")
|
21 |
+
|
22 |
+
|
23 |
+
ensure_flash_attn()
|
24 |
|
25 |
model_path = snapshot_download(repo_id="Skywork/UniPic2-Metaquery-9B")
|
26 |
qwen_vl_path = snapshot_download(repo_id="Qwen/Qwen2.5-VL-7B-Instruct-AWQ")
|