Skip to content

Commit

Permalink
Update descriptions for the functions
Browse files Browse the repository at this point in the history
Adds short and long descriptions.
  • Loading branch information
gorkem committed Oct 31, 2024
1 parent ee4b924 commit a4e5e83
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 15 deletions.
9 changes: 8 additions & 1 deletion gguf/dagger/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// Dagger functions for working with GGUF format for AI/ML models.

// ConvertToGGuf converts a model to GGUF format.
// Quantize applies quantization to a given model(gguf) file.
//
// Uses tools from llama.cpp project to perform the conversion and quantization.

package main

import (
Expand All @@ -8,7 +15,7 @@ import (
const (
ggufConvertScript = "/app/convert_hf_to_gguf.py"
llamacppImageRef = "ghcr.io/ggerganov/llama.cpp:full"
convertedFileName = "converted.gguf"
convertedFileName = "converted.gguf"
quantizedFileName = "quantized.gguf"
)

Expand Down
7 changes: 7 additions & 0 deletions huggingface/dagger/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// Dagger functions for downloading Huggingface repos and files.
//
// DownloadRepo downloads a Huggingface repo and returns the Directory to the downloaded repo.
// DownloadFile downloads a single file from Huggingface repo and returns the File.
//
// Uses the Huggingface CLI to download the repos and files.

package main

import (
Expand Down
16 changes: 16 additions & 0 deletions kit/dagger/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
// Functions for working with ModelKits in Dagger
//
// ModelKit is an OCI-compliant packaging format, that
// encapsulates datasets, code, docs, configurations, and model weights
// into a single, standardized unit.
//
// See kitops.ml for more information.
//
// Uses the Kit CLI to pack, unpack, pull, push, and tag ModelKits.

package main

import (
Expand Down Expand Up @@ -150,6 +160,7 @@ func (m *Kit) baseContainer(_ context.Context) (*dagger.Container, error) {
return m.Container, nil
}

// Authenticates the user with the remote registry
func (m *Kit) WithAuth(ctx context.Context, username string, password *dagger.Secret) (*Kit, error) {
cmd := []string{kitCommand, "login", "-v", m.Registry, "-u", username, "-p", "$KIT_PASSWORD"}
if m.PlainHTTP {
Expand All @@ -174,6 +185,7 @@ func (m *Kit) WithAuth(ctx context.Context, username string, password *dagger.Se
return m, nil
}

// Packs a directory into a ModelKit
func (m *Kit) Pack(ctx context.Context,
// directory to pack
directory *dagger.Directory,
Expand Down Expand Up @@ -202,6 +214,7 @@ func (m *Kit) Pack(ctx context.Context,
return m, nil
}

// Unpacks a ModelKit into a directory
func (m *Kit) Unpack(ctx context.Context,
// reference to the ModelKit
reference string,
Expand All @@ -228,6 +241,7 @@ func (m *Kit) Unpack(ctx context.Context,
Directory("/unpack"), nil
}

// Pulls a ModelKit from the registry
func (m *Kit) Pull(ctx context.Context, reference string) (*Kit, error) {
cmd := []string{kitCommand, "pull", reference}
if m.PlainHTTP {
Expand All @@ -246,6 +260,7 @@ func (m *Kit) Pull(ctx context.Context, reference string) (*Kit, error) {
return m, nil
}

// Pushes a ModelKit to the registry
func (m *Kit) Push(ctx context.Context, reference string) error {
cmd := []string{kitCommand, "push", reference}
if m.PlainHTTP {
Expand All @@ -265,6 +280,7 @@ func (m *Kit) Push(ctx context.Context, reference string) error {
return nil
}

// Tags a ModelKit
func (m *Kit) Tag(ctx context.Context, currentRef string, newRef string) (*Kit, error) {
cmd := []string{kitCommand, "tag", currentRef, newRef}
if m.PlainHTTP {
Expand Down
14 changes: 0 additions & 14 deletions tests/main.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
// A generated module for HfToModelkit functions
//
// This module has been generated via dagger init and serves as a reference to
// basic module structure as you get started with Dagger.
//
// Two functions have been pre-created. You can modify, delete, or add to them,
// as needed. They demonstrate usage of arguments and return types using simple
// echo and grep commands. The functions can be called from the dagger CLI or
// from one of the SDKs.
//
// The first line in this comment block is a short description line and the
// rest is a long description with more detail on the module's purpose or usage,
// if appropriate. All modules should have a short description.

package main

import (
Expand Down

0 comments on commit a4e5e83

Please sign in to comment.