Spaces:
Running
on
Zero
Running
on
Zero
update space
Browse files
app.py
CHANGED
@@ -6,6 +6,7 @@ from PIL import Image
|
|
6 |
import numpy as np
|
7 |
import transformers
|
8 |
from typing import Dict, Optional, Sequence, List
|
|
|
9 |
|
10 |
import sys
|
11 |
from oryx.conversation import conv_templates, SeparatorStyle
|
@@ -77,7 +78,7 @@ def preprocess_qwen(sources, tokenizer: transformers.PreTrainedTokenizer, has_im
|
|
77 |
targets = torch.tensor(targets, dtype=torch.long)
|
78 |
return input_ids
|
79 |
|
80 |
-
|
81 |
def oryx_inference(video, text):
|
82 |
vr = VideoReader(video, ctx=cpu(0))
|
83 |
total_frame_num = len(vr)
|
|
|
6 |
import numpy as np
|
7 |
import transformers
|
8 |
from typing import Dict, Optional, Sequence, List
|
9 |
+
import spaces
|
10 |
|
11 |
import sys
|
12 |
from oryx.conversation import conv_templates, SeparatorStyle
|
|
|
78 |
targets = torch.tensor(targets, dtype=torch.long)
|
79 |
return input_ids
|
80 |
|
81 |
+
@spaces.GPU(duration=120)
|
82 |
def oryx_inference(video, text):
|
83 |
vr = VideoReader(video, ctx=cpu(0))
|
84 |
total_frame_num = len(vr)
|