huggingface

package
v3.80.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: AGPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FINEGRAINED = "fineGrained"
	WRITE       = "write"
	READ        = "read"
)

Variables

This section is empty.

Functions

func AnalyzePermissions

func AnalyzePermissions(cfg *config.Config, key string)

AnalyzePermissions prints the permissions of a HuggingFace API key

Types

type HFTokenJSON

type HFTokenJSON struct {
	Username string `json:"name"`
	Name     string `json:"fullname"`
	Orgs     []struct {
		Name         string `json:"name"`
		Role         string `json:"roleInOrg"`
		IsEnterprise bool   `json:"isEnterprise"`
	} `json:"orgs"`
	Auth struct {
		AccessToken struct {
			Name        string `json:"displayName"`
			Type        string `json:"role"`
			CreatedAt   string `json:"createdAt"`
			FineGrained struct {
				Global []string `json:"global"`
				Scoped []struct {
					Entity struct {
						Type string `json:"type"`
						Name string `json:"name"`
						ID   string `json:"_id"`
					} `json:"entity"`
					Permissions []string `json:"permissions"`
				} `json:"scoped"`
			} `json:"fineGrained"`
		}
	} `json:"auth"`
}

HFTokenJSON is the struct for the HF /whoami-v2 API JSON response

type Model

type Model struct {
	Name        string `json:"id"`
	ID          string `json:"_id"`
	Private     bool   `json:"private"`
	Permissions Permissions
}

type Permissions

type Permissions struct {
	Read  bool
	Write bool
}

Jump to

Keyboard shortcuts

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