Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ from decord import VideoReader, cpu
|
|
5 |
from PIL import Image
|
6 |
import numpy as np
|
7 |
import transformers
|
|
|
8 |
from typing import Dict, Optional, Sequence, List
|
9 |
|
10 |
import subprocess
|
@@ -81,7 +82,7 @@ def preprocess_qwen(sources, tokenizer: transformers.PreTrainedTokenizer, has_im
|
|
81 |
targets = torch.tensor(targets, dtype=torch.long)
|
82 |
return input_ids
|
83 |
|
84 |
-
|
85 |
def oryx_inference(video, text):
|
86 |
vr = VideoReader(video, ctx=cpu(0))
|
87 |
total_frame_num = len(vr)
|
|
|
5 |
from PIL import Image
|
6 |
import numpy as np
|
7 |
import transformers
|
8 |
+
import spaces
|
9 |
from typing import Dict, Optional, Sequence, List
|
10 |
|
11 |
import subprocess
|
|
|
82 |
targets = torch.tensor(targets, dtype=torch.long)
|
83 |
return input_ids
|
84 |
|
85 |
+
@spaces.GPU(duration=120)
|
86 |
def oryx_inference(video, text):
|
87 |
vr = VideoReader(video, ctx=cpu(0))
|
88 |
total_frame_num = len(vr)
|