diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ba214e..9bc7748 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,8 +4,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: goto-bus-stop/setup-zig@v2 - with: - version: 0.11.0 - run: zig fmt --check src/*.zig - run: zig build test - run: ./test.sh diff --git a/.vscode/settings.json b/.vscode/settings.json index 87ebf02..978c0f1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -53,6 +53,8 @@ "url": "https://raw.githubusercontent.com/clebert/onecfg-rust/main/schema.json" } ], - "python.formatting.provider": "none", + "zig.buildOnSave": true, + "zig.initialSetupDone": true, + "zig.zls.enableBuildOnSave": true, "zig.zls.enableInlayHints": false } diff --git a/onecfg.json b/onecfg.json index 12027be..b5fad9f 100644 --- a/onecfg.json +++ b/onecfg.json @@ -19,7 +19,7 @@ "runs-on": "ubuntu-latest", "steps": [ {"uses": "actions/checkout@v4"}, - {"uses": "goto-bus-stop/setup-zig@v2", "with": {"version": "0.11.0"}}, + {"uses": "goto-bus-stop/setup-zig@v2"}, {"run": "zig fmt --check src/*.zig"}, {"run": "zig build test"}, {"run": "./test.sh"} @@ -58,8 +58,10 @@ "value": { "files.exclude": {".github": true, ".github/workflows/ci.yml": true}, "[python]": {"editor.defaultFormatter": "ms-python.black-formatter"}, - "python.formatting.provider": "none", "[zig]": {"editor.defaultFormatter": "ziglang.vscode-zig"}, + "zig.buildOnSave": true, + "zig.initialSetupDone": true, + "zig.zls.enableBuildOnSave": true, "zig.zls.enableInlayHints": false } } diff --git a/src/checkpoint.zig b/src/checkpoint.zig index 0781c77..fe5da8a 100644 --- a/src/checkpoint.zig +++ b/src/checkpoint.zig @@ -267,7 +267,7 @@ fn readLegacy(allocator: std.mem.Allocator, file: std.fs.File) !Self { const signed_vocab_size = try file.reader().readIntLittle(i32); const shared_output_matrix = signed_vocab_size > 0; - const vocab_size: usize = std.math.absCast(signed_vocab_size); + const vocab_size: usize = @abs(signed_vocab_size); const max_sequence_length: usize = @intCast(try file.reader().readIntLittle(i32)); const token_embedding_vectors = try Tensor(2).init(