Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ def test_generation(self):

samples = self._load_datasamples(1)
inputs = processor(
samples,
audio=samples,
).to(torch_device)

out = model.generate(**inputs)
Expand Down Expand Up @@ -667,7 +667,7 @@ def test_generation_batched(self):

samples = self._load_datasamples(4)
inputs = processor(
samples,
audio=samples,
).to(torch_device)

out = model.generate(**inputs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,8 @@ def setUpClass(cls):
except Exception:
local_tiny_video = None

local_videos = [
os.path.join(repo_root, "Big_Buck_Bunny_720_10s_10MB.mp4"),
os.path.join(repo_root, "sample_demo_1.mp4"),
]
cls.local_tiny_video = local_tiny_video
MODALITY_INPUT_DATA["images"] = [local_image, local_image]
MODALITY_INPUT_DATA["videos"] = local_videos

# Force video decoding to use torchvision backend to avoid torchcodec dependency during tests
video_processing_utils.is_torchcodec_available = lambda: False # type: ignore
Expand Down
4 changes: 2 additions & 2 deletions tests/models/longcat_flash/test_modeling_longcat_flash.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def test_shortcat_generation(self):
).to(self.model.device)

with torch.no_grad():
outputs = self.model.generate(inputs, max_new_tokens=10, do_sample=False)
outputs = self.model.generate(inputs["input_ids"], max_new_tokens=10, do_sample=False)

response = self.tokenizer.batch_decode(outputs, skip_special_tokens=False)[0]
expected_output = "[Round 0] USER:Paris is... ASSISTANT: dig年车龄juanaheast稍achaotingupebarebones"
Expand All @@ -370,7 +370,7 @@ def test_longcat_generation_cpu(self):
inputs = tokenizer.apply_chat_template(chat, tokenize=True, add_generation_prompt=True, return_tensors="pt")

with torch.no_grad():
outputs = model.generate(inputs, max_new_tokens=3, do_sample=False)
outputs = model.generate(inputs["input_ids"], max_new_tokens=3, do_sample=False)

response = tokenizer.batch_decode(outputs, skip_special_tokens=False)[0]
expected_output = "[Round 0] USER:Paris is... ASSISTANT:Paris is..."
Expand Down
Loading