Skip to content

Commit

Permalink
Minor improvements (#9)
Browse files Browse the repository at this point in the history
* Add transcription ID to global logger

* Log whisper context config
  • Loading branch information
streamer45 authored Nov 24, 2023
1 parent 4c22426 commit 0c3e190
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmd/transcriber/apis/whisper.cpp/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import "C"

import (
"fmt"
"log/slog"
"os"
"runtime"
"unsafe"
Expand Down Expand Up @@ -57,6 +58,8 @@ func NewContext(cfg Config) (*Context, error) {
}
c.cfg = cfg

slog.Debug("creating transcription context", slog.Any("cfg", cfg))

// TODO: verify whether there's any potential optimizations
// that could be made by using lower level initialization methods
// such as whisper_init or whisper_init_from_buffer.
Expand Down
2 changes: 1 addition & 1 deletion cmd/transcriber/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func main() {
AddSource: true,
Level: slog.LevelDebug,
ReplaceAttr: slogReplaceAttr,
}))
})).With("trID", os.Getenv("TRANSCRIPTION_ID"))
slog.SetDefault(logger)

pid := os.Getpid()
Expand Down

0 comments on commit 0c3e190

Please sign in to comment.