Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,20 @@ import json
|
|
| 10 |
import csv
|
| 11 |
import io
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
@spaces.GPU
|
| 16 |
def read_video_pyav(container, indices):
|
|
|
|
| 10 |
import csv
|
| 11 |
import io
|
| 12 |
|
| 13 |
+
quantization_config = BitsAndBytesConfig(
|
| 14 |
+
load_in_4bit=True,
|
| 15 |
+
bnb_4bit_compute_dtype=torch.float16
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
model_name = 'llava-hf/LLaVA-NeXT-Video-7B-DPO-hf'
|
| 19 |
+
|
| 20 |
+
processor = LlavaNextVideoProcessor.from_pretrained(model_name)
|
| 21 |
+
model = LlavaNextVideoForConditionalGeneration.from_pretrained(
|
| 22 |
+
model_name,
|
| 23 |
+
quantization_config=quantization_config,
|
| 24 |
+
device_map='auto'
|
| 25 |
+
)
|
| 26 |
+
|
| 27 |
|
| 28 |
@spaces.GPU
|
| 29 |
def read_video_pyav(container, indices):
|