Mohit Agarwal commited on
Commit
8517b79
·
unverified ·
1 Parent(s): 5e456c0

go : run `go mod tidy` before building examples + fix permissions (#296)

Browse files

* 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

bindings/go/.gitignore CHANGED
File without changes
bindings/go/LICENSE CHANGED
File without changes
bindings/go/Makefile CHANGED
@@ -11,8 +11,7 @@ whisper: mkdir
11
  @${CMAKE} -S ../.. -B ${BUILD_DIR} -D BUILD_SHARED_LIBS=off -D WHISPER_NO_AVX2=on
12
  @${CMAKE} --build ${BUILD_DIR} --target whisper
13
 
14
- test: model-small whisper
15
- @go mod tidy
16
  @go test -v .
17
  @go test -v ./pkg/whisper/...
18
 
@@ -21,7 +20,7 @@ examples: $(EXAMPLES_DIR)
21
  model-small: mkdir examples/go-model-download
22
  @${BUILD_DIR}/go-model-download -out models small.en
23
 
24
- $(EXAMPLES_DIR): mkdir whisper
25
  @echo Build example $(notdir $@)
26
  @go build ${BUILD_FLAGS} -o ${BUILD_DIR}/$(notdir $@) ./$@
27
 
@@ -31,8 +30,10 @@ mkdir:
31
  @echo Mkdir ${MODELS_DIR}
32
  @install -d ${MODELS_DIR}
33
 
 
 
 
34
  clean:
35
  @echo Clean
36
  @rm -fr $(BUILD_DIR)
37
- @go mod tidy
38
  @go clean
 
11
  @${CMAKE} -S ../.. -B ${BUILD_DIR} -D BUILD_SHARED_LIBS=off -D WHISPER_NO_AVX2=on
12
  @${CMAKE} --build ${BUILD_DIR} --target whisper
13
 
14
+ test: model-small whisper modtidy
 
15
  @go test -v .
16
  @go test -v ./pkg/whisper/...
17
 
 
20
  model-small: mkdir examples/go-model-download
21
  @${BUILD_DIR}/go-model-download -out models small.en
22
 
23
+ $(EXAMPLES_DIR): mkdir whisper modtidy
24
  @echo Build example $(notdir $@)
25
  @go build ${BUILD_FLAGS} -o ${BUILD_DIR}/$(notdir $@) ./$@
26
 
 
30
  @echo Mkdir ${MODELS_DIR}
31
  @install -d ${MODELS_DIR}
32
 
33
+ modtidy:
34
+ @go mod tidy
35
+
36
  clean:
37
  @echo Clean
38
  @rm -fr $(BUILD_DIR)
 
39
  @go clean
bindings/go/README.md CHANGED
File without changes
bindings/go/examples/go-model-download/context.go CHANGED
File without changes
bindings/go/examples/go-model-download/main.go CHANGED
File without changes
bindings/go/examples/go-whisper/flags.go CHANGED
File without changes
bindings/go/examples/go-whisper/main.go CHANGED
File without changes
bindings/go/examples/go-whisper/process.go CHANGED
File without changes
bindings/go/go.mod CHANGED
File without changes
bindings/go/pkg/whisper/consts.go CHANGED
File without changes
bindings/go/pkg/whisper/context.go CHANGED
File without changes
bindings/go/pkg/whisper/context_test.go CHANGED
File without changes
bindings/go/pkg/whisper/doc.go CHANGED
File without changes
bindings/go/pkg/whisper/interface.go CHANGED
File without changes
bindings/go/pkg/whisper/model.go CHANGED
File without changes
bindings/go/samples/jfk.wav CHANGED
File without changes