wandb

package module
v0.0.0-...-9858dad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2024 License: MIT Imports: 7 Imported by: 0

README

WandB-Go

Wrapping the public Weights & Biases GraphQL API in Go

Setup

First, make sure you are signed in to Weights & Biases. You can do this by using the python client and running wandb login in your terminal. Or you can manually create a file called .netrc in your home directory and add the following lines to it:

machine api.wandb.ai
  login user
  password <your api key>

You can find your api key in your Weights & Biases settings or here.

Then, you can use the wandb-go package to query the Weights & Biases GraphQL API.

Once signed in we can generate the Go code for the GraphQL API by running go run github.com/Khan/genqlient.

Usage

With everything in place we can start using it. As the public GraphQL API is authorization protected, we need to set up the client to use the stored api key. Take a look at main.go for this.

Disclaimer

This is an unofficial wrapper around the Weights & Biases GraphQL API. It is not affiliated with Weights & Biases in any way.

It is still work in progress and some queries might not work as expected.

Roadmap

Most important features:

  • init
  • finish
  • config
  • log

Complete feature list:

  • System metrics tracking
  • Code Saving
  • Storing system info in metadata
  • resuming/reinitializing runs
  • Main functions:
    • init
    • log
    • log_artifact
    • log_code
    • config
    • metadata:
      • summary
      • notes
      • tags
      • name
    • finish run (automatically?)
  • offline mode
  • connect to self-hosted servers

First try to mimic javascript client. simpler and easier.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCredentials

func AddCredentials(req *http.Request) (added bool)

AddCredentials fills in the user's credentials for req, if any. The return value reports whether any matching credentials were found.

func Finish

func Finish()

func Log

func Log[T Loggable](key string, value T)

func SetConfig

func SetConfig(config map[string]any)

Types

type Loggable

type Loggable interface {
	Table | ~int | ~float64 | ~float32 | ~string
}

type Run

type Run struct {
}

func Init

func Init(entity string, project string) Run

type Table

type Table struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL