Skip to content

Commit

Permalink
fix 2.6 slice placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
YuzaChongyi authored Aug 11, 2024
1 parent 251a4c2 commit 791c977
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions finetune/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,14 @@ def split_to_patches(image, grid):


def get_grid_placeholder(tokenizer, grid, query_num, new_schema=False):
image_placeholder = (
tokenizer.im_start + tokenizer.unk_token * query_num + tokenizer.im_end
)
if new_schema:
image_placeholder = (
tokenizer.slice_start + tokenizer.unk_token * query_num + tokenizer.slice_end
)
else:
image_placeholder = (
tokenizer.im_start + tokenizer.unk_token * query_num + tokenizer.im_end
)

cols = grid[0]
rows = grid[1]
Expand Down

0 comments on commit 791c977

Please sign in to comment.