Merge branch 'master' of https://github.com/ggerganov/whisper.cpp into add-mac-test

pull/357/head
Chidi Williams 3 years ago
commit 2963ebb99e

@ -8,6 +8,7 @@
#include <SDL.h> #include <SDL.h>
#include <SDL_audio.h> #include <SDL_audio.h>
#include <atomic>
#include <cassert> #include <cassert>
#include <cstdio> #include <cstdio>
#include <string> #include <string>
@ -144,7 +145,7 @@ private:
int m_len_ms = 0; int m_len_ms = 0;
int m_sample_rate = 0; int m_sample_rate = 0;
bool m_running = false; std::atomic_bool m_running;
std::mutex m_mutex; std::mutex m_mutex;
std::vector<float> m_audio; std::vector<float> m_audio;
@ -155,6 +156,8 @@ private:
audio_async::audio_async(int len_ms) { audio_async::audio_async(int len_ms) {
m_len_ms = len_ms; m_len_ms = len_ms;
m_running = false;
} }
audio_async::~audio_async() { audio_async::~audio_async() {
@ -427,10 +430,10 @@ int main(int argc, char ** argv) {
const int n_samples_keep = (params.keep_ms *1e-3)*WHISPER_SAMPLE_RATE; const int n_samples_keep = (params.keep_ms *1e-3)*WHISPER_SAMPLE_RATE;
const int n_samples_30s = (30000 *1e-3)*WHISPER_SAMPLE_RATE; const int n_samples_30s = (30000 *1e-3)*WHISPER_SAMPLE_RATE;
const int n_new_line = params.length_ms / params.step_ms - 1; // number of steps to print new line
const bool use_vad = n_samples_step <= 0; // sliding window mode uses VAD const bool use_vad = n_samples_step <= 0; // sliding window mode uses VAD
const int n_new_line = !use_vad ? params.length_ms / params.step_ms - 1 : 1; // number of steps to print new line
params.no_timestamps = !use_vad; params.no_timestamps = !use_vad;
params.no_context = use_vad; params.no_context = use_vad;
params.max_tokens = 0; params.max_tokens = 0;

@ -40,7 +40,7 @@ if exist "ggml-%model%.bin" (
goto :eof goto :eof
) )
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri https://huggingface.co/datasets/ggerganov/whisper.cpp/raw/main/ggml-%model%.bin -OutFile ggml-%model%.bin" PowerShell -NoProfile -ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri https://huggingface.co/datasets/ggerganov/whisper.cpp/resolve/main/ggml-%model%.bin -OutFile ggml-%model%.bin"
if %ERRORLEVEL% neq 0 ( if %ERRORLEVEL% neq 0 (
echo Failed to download ggml model %model% echo Failed to download ggml model %model%

Loading…
Cancel
Save