Skip to content

Commit 606b045

Browse files
author
Jaakko Heusala
committed
Work in progress.
1 parent c93fc9e commit 606b045

File tree

8 files changed

+1821
-17
lines changed

8 files changed

+1821
-17
lines changed

.cursor/rules/go-autonomous.mdc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
description: "Instruct Cursor to act autonomously toward the goal without prompting for confirmation."
3+
globs:
4+
alwaysApply: false
5+
---
6+
7+
# Autonomous Execution Rule
8+
9+
**Purpose:** Enable Cursor IDE to take initiative on achieving a defined goal--performing analysis, refactoring, or fixes--without asking follow-up questions.
10+
11+
## Guidelines
12+
13+
1. **Immediate Action**
14+
15+
* Upon recognizing the goal, proceed with all detection, analysis, and corrective steps automatically.
16+
* Do not prompt the user for intermediate approvals or clarifications.
17+
18+
2. **Continuous Context Usage**
19+
20+
* Leverage available context (task descriptions, code comments, existing rules) to make informed decisions.
21+
* Assume sufficient knowledge; refrain from asking questions about scope or next steps.
22+
23+
3. **End-to-End Completion**
24+
25+
* Execute the full workflow: detect issues, apply minimal fixes, verify results, and summarize actions.
26+
* Complete each phase in sequence without interruption.
27+
28+
4. **Concise Reporting**
29+
30+
* After finishing, provide a brief summary of actions taken, remaining tasks (if any), and verification outcomes.
31+
* Avoid intermediate or verbose prompts during execution.

pkg/bitnet/assets/assets.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ import (
66
)
77

88
//go:embed models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf
9+
//go:embed models/BitNet-b1.58-2B-4T/tokenizer.json
910
var modelFS embed.FS
1011

11-
// GetModelFile returns the embedded model file as a byte slice.
12+
// GetModelFile returns the embedded GGUF model file as a byte slice.
1213
func GetModelFile() ([]byte, error) {
1314
return modelFS.ReadFile("models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf")
1415
}
16+
17+
// GetTokenizerFile returns the embedded tokenizer file as a byte slice.
18+
func GetTokenizerFile() ([]byte, error) {
19+
return modelFS.ReadFile("models/BitNet-b1.58-2B-4T/tokenizer.json")
20+
}

pkg/bitnet/assets/assets_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package assets
22

33
import (
4+
"os"
45
"testing"
56
)
67

@@ -17,3 +18,17 @@ func TestGetModelFile(t *testing.T) {
1718
t.Fatalf("Model file seems too small: %d bytes", len(data))
1819
}
1920
}
21+
22+
func TestEmbeddedModelFileSizeMatchesDisk(t *testing.T) {
23+
embedded, err := GetModelFile()
24+
if err != nil {
25+
t.Fatalf("failed to read embedded model: %v", err)
26+
}
27+
diskInfo, err := os.Stat("models/BitNet-b1.58-2B-4T/ggml-model-i2_s.gguf")
28+
if err != nil {
29+
t.Fatalf("failed to stat model file on disk: %v", err)
30+
}
31+
if int64(len(embedded)) != diskInfo.Size() {
32+
t.Errorf("embedded model size (%d) does not match disk file size (%d)", len(embedded), diskInfo.Size())
33+
}
34+
}

0 commit comments

Comments
 (0)