File tree 1 file changed +6
-25
lines changed
1 file changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -235,31 +235,12 @@ struct EvaluateCommand: AsyncParsableCommand {
235
235
?? modelConfiguration. defaultPrompt
236
236
let images = image. map { UserInput . Image. url ( $0) }
237
237
let videos = video. map { UserInput . Video. url ( $0) }
238
- let messages : [ [ String : Any ] ] =
239
- if !images. isEmpty || !videos. isEmpty {
240
- [
241
- [
242
- " role " : " user " ,
243
- " content " : [
244
- [
245
- " type " : " text " ,
246
- " text " : generate. system,
247
- ]
248
- ]
249
- // Messages format for Qwen 2 VL, Qwen 2.5 VL. May need to be adapted for other models.
250
- + images. map { _ in [ " type " : " image " ] }
251
- + videos. map { _ in [ " type " : " video " ] } ,
252
- ]
253
- ]
254
- } else {
255
- [
256
- [
257
- " role " : " user " ,
258
- " content " : prompt,
259
- ]
260
- ]
261
- }
262
- var userInput = UserInput ( messages: messages, images: images, videos: videos)
238
+ var userInput = UserInput (
239
+ chat: [
240
+ . system( generate. system) ,
241
+ . user( prompt, images: images, videos: videos) ,
242
+ ] ,
243
+ )
263
244
if !resize. isEmpty {
264
245
let size : CGSize
265
246
if resize. count == 1 {
You can’t perform that action at this time.
0 commit comments