Skip to content

Commit def53d2

Browse files
authored
Merge pull request #870 from docker/remove-dead-code
Remove dead code
2 parents ed5aba0 + f7ecfba commit def53d2

23 files changed

Lines changed: 14 additions & 416 deletions

File tree

cmd/cli/readline/errors.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,3 @@ import (
55
)
66

77
var ErrInterrupt = errors.New("Interrupt")
8-
9-
type InterruptError struct {
10-
Line []rune
11-
}
12-
13-
func (*InterruptError) Error() string {
14-
return "Interrupted"
15-
}

cmd/cli/readline/history.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ func (h *History) Compact() {
9898
}
9999
}
100100

101-
func (h *History) Clear() {
102-
h.Buf.Clear()
103-
}
104-
105101
func (h *History) Prev() (line string) {
106102
if h.Pos > 0 {
107103
h.Pos--

cmd/cli/readline/readline.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,6 @@ func (i *Instance) Readline() (string, error) {
241241
}
242242
}
243243

244-
func (i *Instance) HistoryEnable() {
245-
i.History.Enabled = true
246-
}
247-
248244
func (i *Instance) HistoryDisable() {
249245
i.History.Enabled = false
250246
}

pkg/distribution/builder/builder.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -455,33 +455,6 @@ func (b *Builder) WithChatTemplateFile(path string) (*Builder, error) {
455455
}, nil
456456
}
457457

458-
// WithConfigArchive adds a config archive (tar) file to the artifact.
459-
func (b *Builder) WithConfigArchive(path string) (*Builder, error) {
460-
// Check if config archive already exists.
461-
layers, err := b.model.Layers()
462-
if err != nil {
463-
return nil, fmt.Errorf("get model layers: %w", err)
464-
}
465-
466-
for _, layer := range layers {
467-
mediaType, mediaTypeErr := layer.MediaType()
468-
if mediaTypeErr == nil && mediaType == types.MediaTypeVLLMConfigArchive {
469-
return nil, fmt.Errorf("model already has a config archive layer")
470-
}
471-
}
472-
473-
mt := b.resolveLayerMediaType(types.MediaTypeVLLMConfigArchive)
474-
configLayer, err := partial.NewLayer(path, mt)
475-
if err != nil {
476-
return nil, fmt.Errorf("config archive layer from %q: %w", path, err)
477-
}
478-
return &Builder{
479-
model: mutate.AppendLayers(b.model, configLayer),
480-
originalLayers: b.originalLayers,
481-
outputFormat: b.outputFormat,
482-
}, nil
483-
}
484-
485458
// Target represents a build target
486459
type Target interface {
487460
Write(context.Context, types.ModelArtifact, io.Writer) error

pkg/distribution/builder/from_directory.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010

1111
"github.com/docker/model-runner/pkg/distribution/files"
1212
"github.com/docker/model-runner/pkg/distribution/format"
13-
"github.com/docker/model-runner/pkg/distribution/internal/mutate"
1413
"github.com/docker/model-runner/pkg/distribution/internal/partial"
1514
"github.com/docker/model-runner/pkg/distribution/modelpack"
1615
"github.com/docker/model-runner/pkg/distribution/oci"
@@ -382,21 +381,3 @@ func fileTypeToMediaType(ft files.FileType) oci.MediaType {
382381
return types.MediaTypeModelFile
383382
}
384383
}
385-
386-
// WithFileLayer adds an individual file layer with a relative path annotation.
387-
// This is useful for adding files that should be extracted to a specific path.
388-
func (b *Builder) WithFileLayer(absPath, relPath string) (*Builder, error) {
389-
// Classify the file to determine media type
390-
fileType := files.Classify(absPath)
391-
mediaType := fileTypeToMediaType(fileType)
392-
393-
layer, err := partial.NewLayerWithRelativePath(absPath, relPath, mediaType)
394-
if err != nil {
395-
return nil, fmt.Errorf("file layer from %q: %w", absPath, err)
396-
}
397-
398-
return &Builder{
399-
model: mutate.AppendLayers(b.model, layer),
400-
originalLayers: b.originalLayers,
401-
}, nil
402-
}

pkg/distribution/huggingface/client.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,6 @@ func WithToken(token string) ClientOption {
7272
}
7373
}
7474

75-
// WithTransport sets the HTTP transport for the client
76-
func WithTransport(transport http.RoundTripper) ClientOption {
77-
return func(c *Client) {
78-
if transport != nil {
79-
c.httpClient.Transport = transport
80-
}
81-
}
82-
}
83-
8475
// WithUserAgent sets the User-Agent header for requests
8576
func WithUserAgent(userAgent string) ClientOption {
8677
return func(c *Client) {

pkg/distribution/huggingface/downloader.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,3 @@ func (pr *progressReader) Read(p []byte) (n int, err error) {
214214
}
215215
return n, err
216216
}
217-
218-
// DownloadSingleFile downloads a single file and returns its local path
219-
func (d *Downloader) DownloadSingleFile(ctx context.Context, file RepoFile) (string, error) {
220-
return d.downloadFileWithProgress(ctx, file, uint64(file.ActualSize()), nil)
221-
}

pkg/distribution/internal/mutate/mutate.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,3 @@ func ContextSize(mdl types.ModelArtifact, cs int32) types.ModelArtifact {
2525
contextSize: &cs,
2626
}
2727
}
28-
29-
// SetManifestOptions applies manifest-level metadata (config media type and
30-
// artifact type) to the given model. The options propagate through subsequent
31-
// mutate wrappers via GetManifestOptions.
32-
func SetManifestOptions(mdl types.ModelArtifact, configMT oci.MediaType, artifactType string) types.ModelArtifact {
33-
return &model{
34-
base: mdl,
35-
configMediaType: configMT,
36-
artifactType: artifactType,
37-
}
38-
}

pkg/distribution/internal/progress/reporter.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,6 @@ func WriteError(w io.Writer, message string, mode oci.Mode) error {
142142
})
143143
}
144144

145-
// WriteWarning writes a warning message
146-
func WriteWarning(w io.Writer, message string, mode oci.Mode) error {
147-
return write(w, oci.ProgressMessage{
148-
Type: oci.TypeWarning,
149-
Message: message,
150-
Mode: mode,
151-
})
152-
}
153-
154145
// write writes a JSON-formatted progress message to the writer
155146
func write(w io.Writer, msg oci.ProgressMessage) error {
156147
if w == nil {

pkg/distribution/internal/utils/utils.go

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)