KoonJamesZ commited on
Commit
3abaf20
·
verified ·
1 Parent(s): 50c573d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -14,7 +14,14 @@ import uuid
14
  import uuid
15
  from ultralytics import YOLO
16
  import gradio as gr
17
-
 
 
 
 
 
 
 
18
  # # default: Load the model on the available device(s)
19
  # model = Qwen2VLForConditionalGeneration.from_pretrained(
20
  # "Qwen/Qwen2-VL-7B-Instruct", torch_dtype="auto", device_map="auto"
 
14
  import uuid
15
  from ultralytics import YOLO
16
  import gradio as gr
17
+ import subprocess
18
+ import sys
19
+ try:
20
+ # Run the pip command
21
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "flash-attn", "--no-build-isolation"])
22
+ print("flash-attn installed successfully.")
23
+ except subprocess.CalledProcessError as e:
24
+ print(f"An error occurred while installing flash-attn: {e}")
25
  # # default: Load the model on the available device(s)
26
  # model = Qwen2VLForConditionalGeneration.from_pretrained(
27
  # "Qwen/Qwen2-VL-7B-Instruct", torch_dtype="auto", device_map="auto"