mirror of
https://github.com/ggerganov/whisper.cpp
synced 2026-04-16 03:45:26 +02:00
* Define and use macro to get context safely * Add test to check SEGV * Move installation guid after usage * [skip ci]Change doc slightly * [skip ci]Fix a typo in README * [skip ci]Add carry_initial_prompt option in README * Define GetVADSegments and use it * Use GetContext * Fix download URI of small.en-tdrz * Fix URI of CoreML models corresponding to quantized models * Cache computed string * Remove unused argument * Add Whisper::Token * Add document comments * Rename function: rb_whisper_token_s_new -> ruby_whisper_token_s_init * Fix size of token * Insert _get into function names * Add Whisper::Token#text * Add test for Whisper::Token#text * Declare static if possible * Change method names * Add Whisper::Token#deconstruct_keys * Add tests for Whisper::Token#deconstruct_keys * Add signatures for Whisper::Token * Complete signature * [skip ci]Add n_tokens to document of Segment
23 lines
733 B
Ruby
23 lines
733 B
Ruby
require "mkmf"
|
|
require_relative "options"
|
|
require_relative "dependencies"
|
|
|
|
cmake = find_executable("cmake") || abort
|
|
options = Options.new(cmake).to_s
|
|
have_library("gomp") rescue nil
|
|
libs = Dependencies.new(cmake, options).to_s
|
|
|
|
$INCFLAGS << " -Isources/include -Isources/ggml/include -Isources/examples"
|
|
$LOCAL_LIBS << " #{libs}"
|
|
$cleanfiles << " build #{libs}"
|
|
|
|
create_makefile "whisper" do |conf|
|
|
conf << <<~EOF
|
|
$(TARGET_SO): #{libs}
|
|
#{libs}: cmake-targets
|
|
cmake-targets:
|
|
#{"\t"}#{cmake} -S sources -B build -D BUILD_SHARED_LIBS=OFF -D CMAKE_ARCHIVE_OUTPUT_DIRECTORY=#{__dir__} -D CMAKE_POSITION_INDEPENDENT_CODE=ON #{options}
|
|
#{"\t"}#{cmake} --build build --config Release --target common whisper
|
|
EOF
|
|
end
|