Skip to content

Commit

Permalink
Switch to Zig nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
clebert committed Oct 20, 2023
1 parent becbf32 commit d5be75c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 4 additions & 2 deletions onecfg.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/checkpoint.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d5be75c

Please sign in to comment.