Skip to content

Commit e450998

Browse files
committed
fix #270
1 parent d3518e4 commit e450998

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Applications/VLMEval/ContentView.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,13 +412,22 @@ class VLMEvaluator {
412412
if !images.isEmpty || !videos.isEmpty {
413413
[
414414
[
415-
"role": "user",
415+
"role": "system",
416416
"content": [
417417
[
418418
"type": "text",
419419
"text": videoURL != nil
420420
? videoSystemPrompt : imageSystemPrompt,
421421
]
422+
],
423+
],
424+
[
425+
"role": "user",
426+
"content": [
427+
[
428+
"type": "text",
429+
"text": prompt,
430+
]
422431
]
423432
// Messages format for Qwen 2 VL, Qwen 2.5 VL. May need to be adapted for other models.
424433
+ images.map { _ in
@@ -427,7 +436,7 @@ class VLMEvaluator {
427436
+ videos.map { _ in
428437
["type": "video"]
429438
},
430-
]
439+
],
431440
]
432441
} else {
433442
[

Tools/llm-tool/LLMTool.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ struct EvaluateCommand: AsyncParsableCommand {
231231
chat: [
232232
.system(generate.system),
233233
.user(prompt, images: images, videos: videos),
234-
],
234+
]
235235
)
236236
if !resize.isEmpty {
237237
let size: CGSize

0 commit comments

Comments
 (0)