Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,7 @@
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import spaces
|
3 |
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor, TextIteratorStreamer
|
@@ -83,7 +87,7 @@ def qwen_inference(media_input, text_input=None):
|
|
83 |
{
|
84 |
"type": media_type,
|
85 |
media_type: media_path,
|
86 |
-
**({"
|
87 |
},
|
88 |
{"type": "text", "text": text_input},
|
89 |
],
|
|
|
1 |
+
import os
|
2 |
+
os.environ["FORCE_QWENVL_VIDEO_READER"] = "decord"
|
3 |
+
|
4 |
+
|
5 |
import gradio as gr
|
6 |
import spaces
|
7 |
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor, TextIteratorStreamer
|
|
|
87 |
{
|
88 |
"type": media_type,
|
89 |
media_type: media_path,
|
90 |
+
**({"fps": 5.0} if media_type == "video" else {}),
|
91 |
},
|
92 |
{"type": "text", "text": text_input},
|
93 |
],
|