Skip to content

examples/server: implement "verbose_json" format with token details - #1781

Merged
ggerganov merged 3 commits into
ggml-org:masterfrom
rmmh:server-verbose
Jan 18, 2024
Merged

ggerganov merged 3 commits into
ggml-org:masterfrom
rmmh:server-verbose

Conversation

@rmmh

@rmmh rmmh commented Jan 18, 2024

Copy link
Copy Markdown
Contributor

This is intended to mirror the format of openai's Python whisper.transcribe() output.

Sample usage and output:

$ curl 127.0.0.1:8080/inference -H "Content-Type: multipart/form-data" -F file="@smallstep.wav" -F response_format="verbose_json" | jq .
{
  "text": " That's one small step for man.\n One giant leap for mankind.\n",
  "segments": [
    {
      "id": 0,
      "text": " That's one small step for man.",
      "start": 0,
      "end": 5,
      "tokens": [
        1320,
        338,
        530,
        1402,
        2239,
        329,
        582,
        13
      ],
      "words": [
        {
          "word": " That",
          "start": 0.16,
          "end": 0.31,
          "probability": 0.31418749690055847
        },
        {
          "word": "'s",
          "start": 0.38,
          "end": 0.49,
          "probability": 0.8378852009773254
        },
...

@rmmh rmmh changed the title implement "verbose_json" format with token details examples/server: implement "verbose_json" format with token details Jan 18, 2024
@ogtayhuseynov0

Copy link
Copy Markdown

I was planning to implement it, thank you for this contribution.

jiahansu pushed a commit to WiseSync/whisper.cpp that referenced this pull request Apr 17, 2024
…#1781)

* examples/server: implement "verbose_json" format with token details.

This is intended to mirror the format of openai's Python
whisper.transcribe() return values.

* server: don't write WAV to a temporary file if not converting

* server: use std::lock_guard instead of manual lock/unlock
viktor-silakov pushed a commit to viktor-silakov/whisper_node_mic.cpp that referenced this pull request May 11, 2024
…#1781)

* examples/server: implement "verbose_json" format with token details.

This is intended to mirror the format of openai's Python
whisper.transcribe() return values.

* server: don't write WAV to a temporary file if not converting

* server: use std::lock_guard instead of manual lock/unlock
iThalay pushed a commit to iThalay/whisper.cpp that referenced this pull request Sep 23, 2024
…#1781)

* examples/server: implement "verbose_json" format with token details.

This is intended to mirror the format of openai's Python
whisper.transcribe() return values.

* server: don't write WAV to a temporary file if not converting

* server: use std::lock_guard instead of manual lock/unlock
iThalay pushed a commit to iThalay/whisper.cpp that referenced this pull request Sep 23, 2024
…#1781)

* examples/server: implement "verbose_json" format with token details.

This is intended to mirror the format of openai's Python
whisper.transcribe() return values.

* server: don't write WAV to a temporary file if not converting

* server: use std::lock_guard instead of manual lock/unlock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants