Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whisper : update the "talk" example #1818

Open
ggerganov opened this issue Jan 30, 2024 · 8 comments
Open

whisper : update the "talk" example #1818

ggerganov opened this issue Jan 30, 2024 · 8 comments
Labels
good first issue Good for newcomers

Comments

@ggerganov
Copy link
Owner

The talk and talk.wasm examples have become a bit stale, using a very old implementation of gpt-2:

It would be nice to bring those examples up-to-date using the latest gpt-2 implementation from ggml: https://github.com/ggerganov/ggml/tree/master/examples/gpt-2

@Yuvraj-Lolage
Copy link

Yuvraj-Lolage commented Feb 5, 2024

Hello,

I'm interested in updating the whisper.cpp repository to use the latest GPT-2 implementation from the ggml repository. Specifically, I plan to copy the contents of thewhisper.cpp of https://github.com/ggerganov/ggml/tree/master/examples/gpt-2 into the whisper.cpp file.

Before proceeding, I wanted to confirm if this is appropriate or not

@ggerganov
Copy link
Owner Author

ggerganov commented Feb 5, 2024

No, you have to copy and adapt the gpt-2 implementation from the examples/gpt-2 in the ggml repo to the examples/talk in this repo. The whisper.cpp file does not need any changes

@tamo
Copy link
Contributor

tamo commented Feb 18, 2024

Something like this? I just copied ggml/examples/gpt-2/main-ctx.cpp to whisper.cpp/examples/talk/gpt-2.cpp
https://github.com/tamo/whisper.cpp/compare/passfile...tamo:whisper.cpp:talkgpt2?expand=1
It builds but I'm not sure it works as expected.
Feel free to use it if it helps.

@shivghai
Copy link

shivghai commented Aug 25, 2024

@ggerganov - tried a first pass at this, would appreciate any feedback (I'm a whisper/ggml noob). Works on an M1 Macbook Pro - #2384

@ggerganov
Copy link
Owner Author

@shivghai Thank you - will try to take a look soon

@xiaogz
Copy link

xiaogz commented Sep 20, 2024

@shivghai I'm still encountering the same error message (#1272) when running the talk example in your branch compared to master at 5b1ce40 2024-09-17 server-use-OS-generated-temp-file-name-for-converted-files-2419 - Toliver. I'm using a mac studio m2 ultra on Sonoma 14.7.

Are you still working on your PR?

@shivghai
Copy link

@xiaogz the PR is up to date/ready - i just tried using my branch, and i can get it to run. Steps to run on my PR:

  1. make talk
  2. ./talk

How are you currently building/running?

@xiaogz
Copy link

xiaogz commented Sep 23, 2024

@shivghai My bad! I made a git mistake. I fetched your forked branch properly and it works.

I also tried the fix myself too which differs from yours:

  • copy over ggml's include and src at commit e7b2390 2024-09-20
  • fix build breakage in whisper.cpp:
diff --git a/src/whisper.cpp b/src/whisper.cpp
index 35874aa..cf7c2c5 100644
--- a/src/whisper.cpp
+++ b/src/whisper.cpp
@@ -177,7 +177,7 @@ static bool ggml_graph_compute_helper(
                          int   n_threads,
          ggml_abort_callback   abort_callback,
                         void * abort_callback_data) {
-    struct ggml_cplan plan = ggml_graph_plan(graph, n_threads);
+    struct ggml_cplan plan = ggml_graph_plan(graph, n_threads, nullptr);

     plan.abort_callback      = abort_callback;
     plan.abort_callback_data = abort_callback_data;
  • fix the buffer size calculations in examples/talk/gpt-2.cpp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
Status: Todo
Development

No branches or pull requests

5 participants