Welvet examples

38. model/entity — .entity files

Open original example ↗Recorded results · not a live execution

Part: VI · Model IO
Package: github.com/openfluke/welvet/model/entity
Status: ok — ✅

When

Checkpoints, HF import, tokenize, sample, or decode (model/entity).

Where

import "github.com/openfluke/welvet/model/entity"

cd 38-entity && source ../env.sh && go run .

Why

HF safetensors are awkward for native topology + packed weights. ENTITY is the Welvet checkpoint.

What

Open/Inspect/IsEntity, LoadBlob/LoadQuantBlob, PackFromHF/ImportFromHF, WriteTransformerFile, SerializeNetwork, WriteCameralFile / LoadCameral (sandwich Stack + TrainMode).

Sample output (captured)

open model.entity: no such file or directory

Live capture from go run ./cmd/runall on local ../../welvet (exit 0).

Source

Copied from the Welvet feature book examples (openfluke.github.io/welvet/examples/38-entity).

main.go

Download source ↓
package main

import (
	"fmt"

	"github.com/openfluke/welvet/model/entity"
)

func main() {
	info, err := entity.Inspect("model.entity")
	if err != nil {
		fmt.Println(err)
		return
	}
	ef, err := entity.Open("model.entity")
	if err != nil {
		panic(err)
	}
	defer ef.Close()
	fmt.Println(info, ef.HasTokenizerBlob())
}