File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
pkg/db/migration/convert/convert000034 Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ type ConvertInstillModel struct {
23
23
// https://instill.tech/abrc/pipelines/stomavision/playground?version=v1.0.0
24
24
// https://instill.tech/leochen5/pipelines/index-preprocess-img-desc/playground?version=v1.0.0
25
25
// https://instill.tech/instill-wombat/pipelines/jumbotron-visual-understanding/preview?version=v4.0.0
26
+ // https://instill.tech/leochen5/pipelines/vlm-text-extraction-id/playground?view=BE8zvSpABUSjscJOGp1nRUaSOuHBUusr
27
+ // https://instill.tech/leochen5/pipelines/image-quality-assureance/playground?view=ruuafgHXWiZtTHZiHVsMiUITK1BeWIA4
26
28
27
29
func (c * ConvertInstillModel ) Migrate () error {
28
30
if err := c .migratePipeline (); err != nil {
@@ -381,6 +383,26 @@ func (c *ConvertInstillModel) updateInstillModelChatRelatedTasks(compName string
381
383
delete (input , "prompt-images" )
382
384
}
383
385
386
+ if v , ok := input ["system-message" ]; ok {
387
+ messages := input ["data" ].(map [string ]interface {})["messages" ].([]map [string ]interface {})
388
+
389
+ newMessage := map [string ]interface {}{
390
+ "content" : []map [string ]interface {}{
391
+ {
392
+ "text" : v ,
393
+ "type" : "text" ,
394
+ },
395
+ },
396
+ "role" : "system" ,
397
+ }
398
+
399
+ messages = append (messages , newMessage )
400
+
401
+ input ["data" ].(map [string ]interface {})["messages" ] = messages
402
+
403
+ delete (input , "system-message" )
404
+ }
405
+
384
406
if v , ok := input ["max-new-tokens" ]; ok {
385
407
input ["parameter" ] = map [string ]interface {}{
386
408
"max-tokens" : v ,
You can’t perform that action at this time.
0 commit comments