Skip to content

Commit 86a277f

Browse files
authored
go : run go mod tidy before building examples + fix permissions (ggml-org#296)
* run `go mod tidy` before building examples Running `make examples` after cloning the repository gives the following error: ``` ... [100%] Built target whisper gmake[3]: Leaving directory '/tmp/exp/whisper.cpp/bindings/go/build' gmake[2]: Leaving directory '/tmp/exp/whisper.cpp/bindings/go/build' gmake[1]: Leaving directory '/tmp/exp/whisper.cpp/bindings/go/build' Build example go-model-download Build example go-whisper examples/go-whisper/process.go:11:2: missing go.sum entry for module providing package github.com/go-audio/wav (imported by github.com/ggerganov/whisper.cpp/bindings/go/examples/go-whisper); to add: go get github.com/ggerganov/whisper.cpp/bindings/go/examples/go-whisper make: *** [Makefile:26: examples/go-whisper] Error 1 ``` * remove executable bit from various files
1 parent 231bebc commit 86a277f

File tree

17 files changed

+5
-4
lines changed

17 files changed

+5
-4
lines changed

Diff for: bindings/go/.gitignore

100755100644
File mode changed.

Diff for: bindings/go/LICENSE

100755100644
File mode changed.

Diff for: bindings/go/Makefile

100755100644
+5-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ whisper: mkdir
1111
@${CMAKE} -S ../.. -B ${BUILD_DIR} -D BUILD_SHARED_LIBS=off -D WHISPER_NO_AVX2=on
1212
@${CMAKE} --build ${BUILD_DIR} --target whisper
1313

14-
test: model-small whisper
15-
@go mod tidy
14+
test: model-small whisper modtidy
1615
@go test -v .
1716
@go test -v ./pkg/whisper/...
1817

@@ -21,7 +20,7 @@ examples: $(EXAMPLES_DIR)
2120
model-small: mkdir examples/go-model-download
2221
@${BUILD_DIR}/go-model-download -out models small.en
2322

24-
$(EXAMPLES_DIR): mkdir whisper
23+
$(EXAMPLES_DIR): mkdir whisper modtidy
2524
@echo Build example $(notdir $@)
2625
@go build ${BUILD_FLAGS} -o ${BUILD_DIR}/$(notdir $@) ./$@
2726

@@ -31,8 +30,10 @@ mkdir:
3130
@echo Mkdir ${MODELS_DIR}
3231
@install -d ${MODELS_DIR}
3332

33+
modtidy:
34+
@go mod tidy
35+
3436
clean:
3537
@echo Clean
3638
@rm -fr $(BUILD_DIR)
37-
@go mod tidy
3839
@go clean

Diff for: bindings/go/README.md

100755100644
File mode changed.

Diff for: bindings/go/examples/go-model-download/context.go

100755100644
File mode changed.

Diff for: bindings/go/examples/go-model-download/main.go

100755100644
File mode changed.

Diff for: bindings/go/examples/go-whisper/flags.go

100755100644
File mode changed.

Diff for: bindings/go/examples/go-whisper/main.go

100755100644
File mode changed.

Diff for: bindings/go/examples/go-whisper/process.go

100755100644
File mode changed.

Diff for: bindings/go/go.mod

100755100644
File mode changed.

Diff for: bindings/go/pkg/whisper/consts.go

100755100644
File mode changed.

Diff for: bindings/go/pkg/whisper/context.go

100755100644
File mode changed.

Diff for: bindings/go/pkg/whisper/context_test.go

100755100644
File mode changed.

Diff for: bindings/go/pkg/whisper/doc.go

100755100644
File mode changed.

Diff for: bindings/go/pkg/whisper/interface.go

100755100644
File mode changed.

Diff for: bindings/go/pkg/whisper/model.go

100755100644
File mode changed.

Diff for: bindings/go/samples/jfk.wav

100755100644
File mode changed.

0 commit comments

Comments
 (0)