fix building with MSVC + SDL2

This commit is contained in:
Judd 2025-02-19 14:43:42 +08:00
parent d682e15090
commit b3a6018bbf
6 changed files with 9 additions and 1 deletions

View File

@ -21,6 +21,7 @@
#include <thread>
#include <vector>
#include <map>
#include <chrono>
// command-line parameters
struct whisper_params {

View File

@ -11,6 +11,7 @@
#include <vector>
#include <deque>
#include <set>
#include <chrono>
using json = nlohmann::json;

View File

@ -12,6 +12,7 @@
#include <vector>
#include <cstring>
#include <sstream>
#include <chrono>
#if defined(_MSC_VER)
#pragma warning(disable: 4244 4267) // possible loss of data

View File

@ -12,7 +12,7 @@
#include <thread>
#include <vector>
#include <fstream>
#include <chrono>
// command-line parameters
struct whisper_params {
@ -157,6 +157,7 @@ int main(int argc, char ** argv) {
cparams.use_gpu = params.use_gpu;
cparams.flash_attn = params.flash_attn;
fprintf(stderr, "whisper_init_from_file_with_params ...\n");
struct whisper_context * ctx = whisper_init_from_file_with_params(params.model.c_str(), cparams);
std::vector<float> pcmf32 (n_samples_30s, 0.0f);
@ -166,6 +167,8 @@ int main(int argc, char ** argv) {
std::vector<whisper_token> prompt_tokens;
// print some info about the processing
fprintf(stderr, "whisper_init_from_file_with_params ok\n");
{
fprintf(stderr, "\n");
if (!whisper_is_multilingual(ctx)) {

View File

@ -15,6 +15,7 @@
#include <vector>
#include <regex>
#include <sstream>
#include <chrono>
static std::vector<llama_token> llama_tokenize(struct llama_context * ctx, const std::string & text, bool add_bos) {
const llama_model * model = llama_get_model(ctx);

View File

@ -3,6 +3,7 @@
#include "grammar-parser.h"
#include "common.h"
#include <thread>
#include <chrono>
WChess::WChess(whisper_context * ctx,
const whisper_full_params & wparams,