Skip to content

Commit

Permalink
go : run go mod tidy before building examples + fix permissions (gg…
Browse files Browse the repository at this point in the history
…erganov#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
  • Loading branch information
0xmohit authored Dec 22, 2022
1 parent 231bebc commit 86a277f
Show file tree
Hide file tree
Showing 17 changed files with 5 additions and 4 deletions.
Empty file modified bindings/go/.gitignore
100755 → 100644
Empty file.
Empty file modified bindings/go/LICENSE
100755 → 100644
Empty file.
9 changes: 5 additions & 4 deletions bindings/go/Makefile
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ whisper: mkdir
@${CMAKE} -S ../.. -B ${BUILD_DIR} -D BUILD_SHARED_LIBS=off -D WHISPER_NO_AVX2=on
@${CMAKE} --build ${BUILD_DIR} --target whisper

test: model-small whisper
@go mod tidy
test: model-small whisper modtidy
@go test -v .
@go test -v ./pkg/whisper/...

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

$(EXAMPLES_DIR): mkdir whisper
$(EXAMPLES_DIR): mkdir whisper modtidy
@echo Build example $(notdir $@)
@go build ${BUILD_FLAGS} -o ${BUILD_DIR}/$(notdir $@) ./$@

Expand All @@ -31,8 +30,10 @@ mkdir:
@echo Mkdir ${MODELS_DIR}
@install -d ${MODELS_DIR}

modtidy:
@go mod tidy

clean:
@echo Clean
@rm -fr $(BUILD_DIR)
@go mod tidy
@go clean
Empty file modified bindings/go/README.md
100755 → 100644
Empty file.
Empty file modified bindings/go/examples/go-model-download/context.go
100755 → 100644
Empty file.
Empty file modified bindings/go/examples/go-model-download/main.go
100755 → 100644
Empty file.
Empty file modified bindings/go/examples/go-whisper/flags.go
100755 → 100644
Empty file.
Empty file modified bindings/go/examples/go-whisper/main.go
100755 → 100644
Empty file.
Empty file modified bindings/go/examples/go-whisper/process.go
100755 → 100644
Empty file.
Empty file modified bindings/go/go.mod
100755 → 100644
Empty file.
Empty file modified bindings/go/pkg/whisper/consts.go
100755 → 100644
Empty file.
Empty file modified bindings/go/pkg/whisper/context.go
100755 → 100644
Empty file.
Empty file modified bindings/go/pkg/whisper/context_test.go
100755 → 100644
Empty file.
Empty file modified bindings/go/pkg/whisper/doc.go
100755 → 100644
Empty file.
Empty file modified bindings/go/pkg/whisper/interface.go
100755 → 100644
Empty file.
Empty file modified bindings/go/pkg/whisper/model.go
100755 → 100644
Empty file.
Empty file modified bindings/go/samples/jfk.wav
100755 → 100644
Empty file.

0 comments on commit 86a277f

Please sign in to comment.