File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
src/guidellm/data/formatters Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -22,11 +22,7 @@ class JinjaTemplatesRegistry(RegistryMixin[Union[Template, str]]):
22
22
textwrap .dedent ("""
23
23
{% set obj = {
24
24
"json_body": {
25
- "prompt": (
26
- text_column[0]
27
- if text_column and text_column|length == 1
28
- else text_column
29
- )
25
+ "prompt": prefix_column[0]|default("") + text_column[0]
30
26
}
31
27
} %}
32
28
@@ -52,6 +48,10 @@ class JinjaTemplatesRegistry(RegistryMixin[Union[Template, str]]):
52
48
{% set obj = {
53
49
"json_body": {
54
50
"messages": [
51
+ {
52
+ "role": "system",
53
+ "content": prefix_column[0]|default("")
54
+ },
55
55
{
56
56
"role": "user",
57
57
"content": []
@@ -61,11 +61,11 @@ class JinjaTemplatesRegistry(RegistryMixin[Union[Template, str]]):
61
61
} %}
62
62
63
63
{%- for item in text_column or [] %}
64
- {% do obj["json_body"].messages[0 ].content.append({"type": "text", "text": item}) %}
64
+ {% do obj["json_body"].messages[1 ].content.append({"type": "text", "text": item}) %}
65
65
{%- endfor %}
66
66
67
67
{%- for item in image_column or [] %}
68
- {% do obj["json_body"].messages[0 ].content.append({
68
+ {% do obj["json_body"].messages[1 ].content.append({
69
69
"type": "image_url",
70
70
"image_url": encode_image(
71
71
item,
@@ -78,7 +78,7 @@ class JinjaTemplatesRegistry(RegistryMixin[Union[Template, str]]):
78
78
{%- endfor %}
79
79
80
80
{%- for item in video_column or [] %}
81
- {% do obj["json_body"].messages[0 ].content.append({
81
+ {% do obj["json_body"].messages[1 ].content.append({
82
82
"type": "video_url",
83
83
"video_url": encode_video(
84
84
item,
You can’t perform that action at this time.
0 commit comments