Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions pkg/backend/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ const (
var (
// mediaTypePriorityMap defines the priority for layer sorting by group.
mediaTypePriorityMap = map[string]int{
legacymodelspec.MediaTypeModelWeightConfig: modelWeightConfigPriority,
legacymodelspec.MediaTypeModelWeight: modelWeightPriority,
legacymodelspec.MediaTypeModelCode: modelCodePriority,
legacymodelspec.MediaTypeModelDoc: modelDocPriority,
modelspec.MediaTypeModelWeightConfig: modelWeightConfigPriority,
modelspec.MediaTypeModelWeight: modelWeightPriority,
modelspec.MediaTypeModelCode: modelCodePriority,
modelspec.MediaTypeModelDoc: modelDocPriority,
}
)

Expand Down Expand Up @@ -143,7 +143,7 @@ func (b *backend) Attach(ctx context.Context, filepath string, cfg *config.Attac
}
}

var config legacymodelspec.Model
var config modelspec.Model
if !cfg.Config {
var reasoning bool
if srcModelConfig.Config.Capabilities != nil && srcModelConfig.Config.Capabilities.Reasoning != nil {
Expand Down Expand Up @@ -307,33 +307,33 @@ func (b *backend) getModelConfig(ctx context.Context, reference string, desc oci

func (b *backend) getProcessor(destDir, filepath string, rawMediaType bool) processor.Processor {
if modelfile.IsFileType(filepath, modelfile.ConfigFilePatterns) {
mediaType := legacymodelspec.MediaTypeModelWeightConfig
mediaType := modelspec.MediaTypeModelWeightConfig
if rawMediaType {
mediaType = legacymodelspec.MediaTypeModelWeightConfigRaw
mediaType = modelspec.MediaTypeModelWeightConfigRaw
}
return processor.NewModelConfigProcessor(b.store, mediaType, []string{filepath}, destDir)
}

if modelfile.IsFileType(filepath, modelfile.ModelFilePatterns) {
mediaType := legacymodelspec.MediaTypeModelWeight
mediaType := modelspec.MediaTypeModelWeight
if rawMediaType {
mediaType = legacymodelspec.MediaTypeModelWeightRaw
mediaType = modelspec.MediaTypeModelWeightRaw
}
return processor.NewModelProcessor(b.store, mediaType, []string{filepath}, destDir)
}

if modelfile.IsFileType(filepath, modelfile.CodeFilePatterns) {
mediaType := legacymodelspec.MediaTypeModelCode
mediaType := modelspec.MediaTypeModelCode
if rawMediaType {
mediaType = legacymodelspec.MediaTypeModelCodeRaw
mediaType = modelspec.MediaTypeModelCodeRaw
}
return processor.NewCodeProcessor(b.store, mediaType, []string{filepath}, destDir)
}

if modelfile.IsFileType(filepath, modelfile.DocFilePatterns) {
mediaType := legacymodelspec.MediaTypeModelDoc
mediaType := modelspec.MediaTypeModelDoc
if rawMediaType {
mediaType = legacymodelspec.MediaTypeModelDocRaw
mediaType = modelspec.MediaTypeModelDocRaw
}
return processor.NewDocProcessor(b.store, mediaType, []string{filepath}, destDir)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/attach_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"reflect"
"testing"

modelspec "github.com/dragonflyoss/model-spec/specs-go/v1"
modelspec "github.com/modelpack/model-spec/specs-go/v1"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/stretchr/testify/assert"

Expand Down
4 changes: 2 additions & 2 deletions pkg/backend/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"path/filepath"

retry "github.com/avast/retry-go/v4"
modelspec "github.com/dragonflyoss/model-spec/specs-go/v1"
modelspec "github.com/modelpack/model-spec/specs-go/v1"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/sirupsen/logrus"

Expand All @@ -40,7 +40,7 @@ import (

const (
// annotationModelfile is the annotation key for the Modelfile.
annotationModelfile = "org.cnai.modctl.modelfile"
annotationModelfile = "org.cncf.modctl.modelfile"
)

// Build builds the user materials into the model artifact which follows the Model Spec.
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/build/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"syscall"
"time"

modelspec "github.com/dragonflyoss/model-spec/specs-go/v1"
sha256 "github.com/minio/sha256-simd"
modelspec "github.com/modelpack/model-spec/specs-go/v1"
godigest "github.com/opencontainers/go-digest"
spec "github.com/opencontainers/image-spec/specs-go"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/build/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"testing"
"time"

modelspec "github.com/dragonflyoss/model-spec/specs-go/v1"
modelspec "github.com/modelpack/model-spec/specs-go/v1"
godigest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/build/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"io"

modelspec "github.com/dragonflyoss/model-spec/specs-go/v1"
modelspec "github.com/modelpack/model-spec/specs-go/v1"
godigest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"

Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/build/local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strings"
"testing"

modelspec "github.com/dragonflyoss/model-spec/specs-go/v1"
modelspec "github.com/modelpack/model-spec/specs-go/v1"
godigest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/stretchr/testify/mock"
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/build/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"io"

modelspec "github.com/dragonflyoss/model-spec/specs-go/v1"
modelspec "github.com/modelpack/model-spec/specs-go/v1"
godigest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"

Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/processor/code_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"path/filepath"
"testing"

modelspec "github.com/dragonflyoss/model-spec/specs-go/v1"
modelspec "github.com/modelpack/model-spec/specs-go/v1"
godigest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/processor/doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
buildmock "github.com/modelpack/modctl/test/mocks/backend/build"
"github.com/modelpack/modctl/test/mocks/storage"

modelspec "github.com/dragonflyoss/model-spec/specs-go/v1"
modelspec "github.com/modelpack/model-spec/specs-go/v1"
godigest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/processor/model_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
buildmock "github.com/modelpack/modctl/test/mocks/backend/build"
"github.com/modelpack/modctl/test/mocks/storage"

modelspec "github.com/dragonflyoss/model-spec/specs-go/v1"
modelspec "github.com/modelpack/model-spec/specs-go/v1"
godigest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion pkg/backend/processor/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
buildmock "github.com/modelpack/modctl/test/mocks/backend/build"
"github.com/modelpack/modctl/test/mocks/storage"

modelspec "github.com/dragonflyoss/model-spec/specs-go/v1"
modelspec "github.com/modelpack/model-spec/specs-go/v1"
godigest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion test/mocks/backend/build/builder.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading