Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions DPF/filters/videos/video_llava_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(
model_base: Optional[str] = None,
cache_path: str = "cache_dir",
prompt: str = "detailed_video",
temperature: float = 0.2,
temperature: float = 0.8,
max_new_tokens: int = 1024,
load_4bit: bool = False,
load_8bit: bool = False,
Expand Down Expand Up @@ -142,13 +142,14 @@ def process_batch(self, batch: list[Any]) -> dict[str, list[Any]]:
do_sample=True if self.temperature > 0 else False,
temperature=self.temperature,
max_new_tokens=self.max_new_tokens,
num_beams=1,
no_repeat_ngram_size=2,
use_cache=True,
stopping_criteria=[self.stopping_criteria])

all_outputs: list[Optional[str]] = []
for i in range(output_ids.shape[0]):
caption = self.tokenizer.decode(output_ids[i, self.input_ids.shape[1]:]).strip().split('</s>')[0]
all_outputs.append(caption)
all_outputs.append(check_caption(caption))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check_caption может вернуть None - такого быть не должно

df_batch_labels[self.schema[1]].extend(all_outputs)
df_batch_labels[self.key_column].extend(keys)
Expand Down