DrishtiSharma commited on
Commit
f90e03a
·
verified ·
1 Parent(s): 3443fdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -0
app.py CHANGED
@@ -3,6 +3,22 @@ from yt_dlp import YoutubeDL
3
  from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
4
  from qwen_vl_utils import process_vision_info
5
  import torch
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  # Title and Description
8
  st.title("Video Analysis with Qwen2-VL")
 
3
  from transformers import Qwen2VLForConditionalGeneration, AutoProcessor
4
  from qwen_vl_utils import process_vision_info
5
  import torch
6
+ import subprocess
7
+ import sys
8
+
9
+ def install_dependencies():
10
+ try:
11
+ # Install torch first
12
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "torch==2.0.1"])
13
+ # Install other dependencies from requirements.txt
14
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements.txt"])
15
+ except subprocess.CalledProcessError as e:
16
+ print(f"Error occurred during dependency installation: {e}")
17
+ sys.exit(1)
18
+
19
+ # Run the dependency installer
20
+ install_dependencies()
21
+
22
 
23
  # Title and Description
24
  st.title("Video Analysis with Qwen2-VL")