mirror of
https://github.com/xzeldon/whisper-api-server.git
synced 2025-07-12 15:04:37 +03:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
dde206facd | |||
2e92dd91cb | |||
dacad9a4f6
|
|||
7d6be4b7d3
|
|||
7b0797cca1
|
21
README.md
21
README.md
@ -11,6 +11,20 @@ This API server enables audio transcription using the OpenAI Whisper models.
|
|||||||
|
|
||||||
# Build from source
|
# Build from source
|
||||||
|
|
||||||
|
Before build make sure that **CGO_ENABLED** env is set to **1**
|
||||||
|
|
||||||
|
```
|
||||||
|
set CGO_ENABLED 1
|
||||||
|
```
|
||||||
|
|
||||||
|
or preferable set it parament. Then check it via
|
||||||
|
|
||||||
|
```
|
||||||
|
go env
|
||||||
|
```
|
||||||
|
|
||||||
|
Also you have to have installed gcc x64 i.e. by MYSYS
|
||||||
|
|
||||||
Download the sources and use `go build`.
|
Download the sources and use `go build`.
|
||||||
For example, you can build using the following command:
|
For example, you can build using the following command:
|
||||||
|
|
||||||
@ -38,10 +52,9 @@ Receive a response in JSON format:
|
|||||||
|
|
||||||
# Usage with [Obsidian](https://obsidian.md/)
|
# Usage with [Obsidian](https://obsidian.md/)
|
||||||
|
|
||||||
To integrate this with the [Obsidian voice recognotion plugin](https://github.com/nikdanilov/whisper-obsidian-plugin), follow these steps:
|
1. Install [Obsidian voice recognotion plugin](https://github.com/nikdanilov/whisper-obsidian-plugin)
|
||||||
|
2. Open the plugin's settings.
|
||||||
1. Open the plugin's settings.
|
3. Set the following values:
|
||||||
2. Set the following values:
|
|
||||||
- API KEY: `sk-1`
|
- API KEY: `sk-1`
|
||||||
- API URL: `http://localhost:3000/v1/audio/transcriptions`
|
- API URL: `http://localhost:3000/v1/audio/transcriptions`
|
||||||
- Model: `whisper-1`
|
- Model: `whisper-1`
|
||||||
|
@ -41,9 +41,6 @@ func InitializeWhisperState(modelPath string) (*WhisperState, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
params.AddFlags(whisper.FlagNoContext)
|
|
||||||
params.AddFlags(whisper.FlagTokenTimestamps)
|
|
||||||
|
|
||||||
fmt.Printf("Params CPU Threads : %d\n", params.CpuThreads())
|
fmt.Printf("Params CPU Threads : %d\n", params.CpuThreads())
|
||||||
|
|
||||||
return &WhisperState{
|
return &WhisperState{
|
||||||
|
@ -86,6 +86,16 @@ func (this *FullParams) RemoveFlags(newflag eFullParamsFlags) {
|
|||||||
this.cStruct.Flags = this.cStruct.Flags ^ newflag
|
this.cStruct.Flags = this.cStruct.Flags ^ newflag
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *FullParams) SetLanguage(language eLanguage) {
|
||||||
|
if this == nil {
|
||||||
|
return
|
||||||
|
} else if this.cStruct == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
this.cStruct.Language = language
|
||||||
|
}
|
||||||
|
|
||||||
/*using pfnNewSegment = HRESULT( __cdecl* )( iContext* ctx, uint32_t n_new, void* user_data ) noexcept;*/
|
/*using pfnNewSegment = HRESULT( __cdecl* )( iContext* ctx, uint32_t n_new, void* user_data ) noexcept;*/
|
||||||
type NewSegmentCallback_Type func(context *IContext, n_new uint32, user_data unsafe.Pointer) EWhisperHWND
|
type NewSegmentCallback_Type func(context *IContext, n_new uint32, user_data unsafe.Pointer) EWhisperHWND
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user