Skip to content

Commit 01b974f

Browse files
committed
fix #270
1 parent 1760779 commit 01b974f

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Applications/VLMEval/ContentView.swift

+11-2
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,22 @@ class VLMEvaluator {
411411
if !images.isEmpty || !videos.isEmpty {
412412
[
413413
[
414-
"role": "user",
414+
"role": "system",
415415
"content": [
416416
[
417417
"type": "text",
418418
"text": videoURL != nil
419419
? videoSystemPrompt : imageSystemPrompt,
420420
]
421+
],
422+
],
423+
[
424+
"role": "user",
425+
"content": [
426+
[
427+
"type": "text",
428+
"text": prompt,
429+
]
421430
]
422431
// Messages format for Qwen 2 VL, Qwen 2.5 VL. May need to be adapted for other models.
423432
+ images.map { _ in
@@ -426,7 +435,7 @@ class VLMEvaluator {
426435
+ videos.map { _ in
427436
["type": "video"]
428437
},
429-
]
438+
],
430439
]
431440
} else {
432441
[

Tools/llm-tool/LLMTool.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ struct EvaluateCommand: AsyncParsableCommand {
239239
chat: [
240240
.system(generate.system),
241241
.user(prompt, images: images, videos: videos),
242-
],
242+
]
243243
)
244244
if !resize.isEmpty {
245245
let size: CGSize

0 commit comments

Comments
 (0)