Skip to content

Commit

Permalink
Merge pull request #38 from Cmxu/collators_fix
Browse files Browse the repository at this point in the history
fix system prompts
  • Loading branch information
zjysteven authored Oct 18, 2024
2 parents 5db747c + 816c126 commit b4ee72c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion collators/llava_1_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]:
if system_prompt is not None:
cur_text.append({
"role": "system",
"content": [{"text": system_prompt}]
"content": [{"type": "text", "text": system_prompt}]
})

for i, text in enumerate(cur_convs):
Expand Down
2 changes: 1 addition & 1 deletion collators/llava_1_6.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]:
if system_prompt is not None:
cur_text.append({
"role": "system",
"content": [{"text": system_prompt}]
"content": [{"type": "text", "text": system_prompt}]
})

for i, text in enumerate(cur_convs):
Expand Down
2 changes: 1 addition & 1 deletion collators/llava_next_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]:
if system_prompt is not None:
cur_text.append({
"role": "system",
"content": [{"text": system_prompt}]
"content": [{"type": "text", "text": system_prompt}]
})

for i, text in enumerate(cur_convs):
Expand Down
2 changes: 1 addition & 1 deletion collators/qwen2_vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]:
if system_prompt is not None:
cur_text.append({
"role": "system",
"content": [{"text": system_prompt}]
"content": [{"type": "text", "text": system_prompt}]
})

for i, text in enumerate(cur_convs):
Expand Down

0 comments on commit b4ee72c

Please sign in to comment.