Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,10 +12,8 @@ from transformers import (
|
|
| 12 |
AutoProcessor,
|
| 13 |
TextIteratorStreamer,
|
| 14 |
)
|
| 15 |
-
from transformers import Qwen2_5_VLForConditionalGeneration
|
| 16 |
-
|
| 17 |
# Helper Functions
|
| 18 |
-
def progress_bar_html(label: str, primary_color: str = "#
|
| 19 |
"""
|
| 20 |
Returns an HTML snippet for a thin animated progress bar with a label.
|
| 21 |
Colors can be customized; default colors are used for Qwen2VL/Aya-Vision.
|
|
@@ -60,9 +58,9 @@ def downsample_video(video_path):
|
|
| 60 |
return frames
|
| 61 |
|
| 62 |
# Model and Processor Setup
|
| 63 |
-
QV_MODEL_ID = "Qwen/Qwen2
|
| 64 |
qwen_processor = AutoProcessor.from_pretrained(QV_MODEL_ID, trust_remote_code=True)
|
| 65 |
-
qwen_model =
|
| 66 |
QV_MODEL_ID,
|
| 67 |
trust_remote_code=True,
|
| 68 |
torch_dtype=torch.float16
|
|
|
|
| 12 |
AutoProcessor,
|
| 13 |
TextIteratorStreamer,
|
| 14 |
)
|
|
|
|
|
|
|
| 15 |
# Helper Functions
|
| 16 |
+
def progress_bar_html(label: str, primary_color: str = "#FF4500", secondary_color: str = "#FFA07A") -> str:
|
| 17 |
"""
|
| 18 |
Returns an HTML snippet for a thin animated progress bar with a label.
|
| 19 |
Colors can be customized; default colors are used for Qwen2VL/Aya-Vision.
|
|
|
|
| 58 |
return frames
|
| 59 |
|
| 60 |
# Model and Processor Setup
|
| 61 |
+
QV_MODEL_ID = "Qwen/Qwen2-VL-7B-Instruct"
|
| 62 |
qwen_processor = AutoProcessor.from_pretrained(QV_MODEL_ID, trust_remote_code=True)
|
| 63 |
+
qwen_model = Qwen2VLForConditionalGeneration.from_pretrained(
|
| 64 |
QV_MODEL_ID,
|
| 65 |
trust_remote_code=True,
|
| 66 |
torch_dtype=torch.float16
|