Skip to content

Commit 73f96e4

Browse files
committed
feat: add cases for migration
1 parent f2cea0e commit 73f96e4

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pkg/db/migration/convert/convert000034/convert.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ type ConvertInstillModel struct {
2323
// https://instill.tech/abrc/pipelines/stomavision/playground?version=v1.0.0
2424
// https://instill.tech/leochen5/pipelines/index-preprocess-img-desc/playground?version=v1.0.0
2525
// 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
2628

2729
func (c *ConvertInstillModel) Migrate() error {
2830
if err := c.migratePipeline(); err != nil {
@@ -381,6 +383,26 @@ func (c *ConvertInstillModel) updateInstillModelChatRelatedTasks(compName string
381383
delete(input, "prompt-images")
382384
}
383385

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+
384406
if v, ok := input["max-new-tokens"]; ok {
385407
input["parameter"] = map[string]interface{}{
386408
"max-tokens": v,

0 commit comments

Comments
 (0)