Update README.md
Browse files
README.md
CHANGED
@@ -40,6 +40,13 @@ pip install qwen-vl-utils livecc-utils
|
|
40 |
Here we show a code snippet to show you how to do **real-time video commentary** with `transformers` and the above utils:
|
41 |
|
42 |
```python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
class LiveCCDemoInfer:
|
44 |
fps = 2
|
45 |
initial_fps_frames = 6
|
|
|
40 |
Here we show a code snippet to show you how to do **real-time video commentary** with `transformers` and the above utils:
|
41 |
|
42 |
```python
|
43 |
+
import functools, torch, os, tqdm
|
44 |
+
from liger_kernel.transformers import apply_liger_kernel_to_qwen2_vl
|
45 |
+
apply_liger_kernel_to_qwen2_vl() # important. our model is trained with this. keep consistency
|
46 |
+
from transformers import Qwen2VLForConditionalGeneration, AutoProcessor, LogitsProcessor, logging
|
47 |
+
from livecc_utils import prepare_multiturn_multimodal_inputs_for_generation, get_smart_resized_clip, get_smart_resized_video_reader
|
48 |
+
from qwen_vl_utils import process_vision_info
|
49 |
+
|
50 |
class LiveCCDemoInfer:
|
51 |
fps = 2
|
52 |
initial_fps_frames = 6
|