Skip to content
TheChatArchiveThe Chat Archive
gpt-4-0125-preview· OpenAIAi2 WildChat-4.8M (AI2)

this is the command guide to use whisper in my terminal but i still dont understand, how…

  1. User

    this is the command guide to use whisper in my terminal but i still dont understand, how do i make it so that i put in a video in japanse and it translate into english

    make base.en

    cc -I. -O3 -std=c11 -pthread -DGGML_USE_ACCELERATE -c ggml.c -o ggml.o c++ -I. -I./examples -O3 -std=c++11 -pthread -c whisper.cpp -o whisper.o c++ -I. -I./examples -O3 -std=c++11 -pthread examples/main/main.cpp whisper.o ggml.o -o main -framework Accelerate ./main -h

    usage: ./main [options] file0.wav file1.wav ...

    options: -h, --help [default] show this help message and exit -t N, --threads N [4 ] number of threads to use during computation -p N, --processors N [1 ] number of processors to use during computation -ot N, --offset-t N [0 ] time offset in milliseconds -on N, --offset-n N [0 ] segment index offset -d N, --duration N [0 ] duration of audio to process in milliseconds -mc N, --max-context N [-1 ] maximum number of text context tokens to store -ml N, --max-len N [0 ] maximum segment length in characters -sow, --split-on-word [false ] split on word rather than on token -bo N, --best-of N [5 ] number of best candidates to keep -bs N, --beam-size N [5 ] beam size for beam search -wt N, --word-thold N [0.01 ] word timestamp probability threshold -et N, --entropy-thold N [2.40 ] entropy threshold for decoder fail -lpt N, --logprob-thold N [-1.00 ] log probability threshold for decoder fail -debug, --debug-mode [false ] enable debug mode (eg. dump log_mel) -tr, --translate [false ] translate from source language to english -di, --diarize [false ] stereo audio diarization -tdrz, --tinydiarize [false ] enable tinydiarize (requires a tdrz model) -nf, --no-fallback [false ] do not use temperature fallback while decoding -otxt, --output-txt [false ] output result in a text file -ovtt, --output-vtt [false ] output result in a vtt file -osrt, --output-srt [false ] output result in a srt file -olrc, --output-lrc [false ] output result in a lrc file -owts, --output-words [false ] output script for generating karaoke video -fp, --font-path [/System/Library/Fonts/Supplemental/Courier New Bold.ttf] path to a monospace font for karaoke video -ocsv, --output-csv [false ] output result in a CSV file -oj, --output-json [false ] output result in a JSON file -ojf, --output-json-full [false ] include more information in the JSON file -of FNAME, --output-file FNAME [ ] output file path (without file extension) -ps, --print-special [false ] print special tokens -pc, --print-colors [false ] print colors -pp, --print-progress [false ] print progress -nt, --no-timestamps [false ] do not print timestamps -l LANG, --language LANG [en ] spoken language ('auto' for auto-detect) -dl, --detect-language [false ] exit after automatically detecting language --prompt PROMPT [ ] initial prompt -m FNAME, --model FNAME [models/ggml-base.en.bin] model path -f FNAME, --file FNAME [ ] input WAV file path -oved D, --ov-e-device DNAME [CPU ] the OpenVINO device used for encode inference -ls, --log-score [false ] log best decoder scores of tokens -ng, --no-gpu [false ] disable GPU

    bash ./models/download-ggml-model.sh base.en Downloading ggml model base.en ... ggml-base.en.bin 100%[========================>] 141.11M 6.34MB/s in 24s Done! Model 'base.en' saved in 'models/ggml-base.en.bin' You can now use it like this:

    $ ./main -m models/ggml-base.en.bin -f samples/jfk.wav

    =============================================== Running base.en on all samples in ./samples ...


    [+] Running base.en on samples/jfk.wav ... (run 'ffplay samples/jfk.wav' to listen)

    whisper_init_from_file: loading model from 'models/ggml-base.en.bin' whisper_model_load: loading model whisper_model_load: n_vocab = 51864 whisper_model_load: n_audio_ctx = 1500 whisper_model_load: n_audio_state = 512 whisper_model_load: n_audio_head = 8 whisper_model_load: n_audio_layer = 6 whisper_model_load: n_text_ctx = 448 whisper_model_load: n_text_state = 512 whisper_model_load: n_text_head = 8 whisper_model_load: n_text_layer = 6 whisper_model_load: n_mels = 80 whisper_model_load: f16 = 1 whisper_model_load: type = 2 whisper_model_load: mem required = 215.00 MB (+ 6.00 MB per decoder) whisper_model_load: kv self size = 5.25 MB whisper_model_load: kv cross size = 17.58 MB whisper_model_load: adding 1607 extra tokens whisper_model_load: model ctx = 140.60 MB whisper_model_load: model size = 140.54 MB

    system_info: n_threads = 4 / 10 | AVX = 0 | AVX2 = 0 | AVX512 = 0 | FMA = 0 | NEON = 1 | ARM_FMA = 1 | F16C = 0 | FP16_VA = 1 | WASM_SIMD = 0 | BLAS = 1 | SSE3 = 0 | VSX = 0 |

    main: processing 'samples/jfk.wav' (176000 samples, 11.0 sec), 4 threads, 1 processors, lang = en, task = transcribe, timestamps = 1 ...

    [00:00:00.000 --> 00:00:11.000] And so my fellow Americans, ask not what your country can do for you, ask what you can do for your country.

    whisper_print_timings: fallbacks = 0 p / 0 h whisper_print_timings: load time = 113.81 ms whisper_print_timings: mel time = 15.40 ms whisper_print_timings: sample time = 11.58 ms / 27 runs ( 0.43 ms per run) whisper_print_timings: encode time = 266.60 ms / 1 runs ( 266.60 ms per run) whisper_print_timings: decode time = 66.11 ms / 27 runs ( 2.45 ms per run) whisper_print_timings: total time = 476.31 ms

  2. Assistant

    To use the provided command guide and software to translate Japanese audio from a video file into English, you would need to extract the audio from the video file first and then use the software with appropriate options to translate. Here's a step-by-step guide on how to handle this process:

    Step 1: Extract Audio from Video

    First, you need to extract the audio from your video file. This can be done using ffmpeg, a powerful multimedia framework that allows you to convert the audio and video streams. If you don't have ffmpeg installed, you should install it first.

    To extract the audio, you can use the following ffmpeg command in your terminal:

    ffmpeg -i input_video_file.mp4 -acodec pcm_s16le -ar 16000 output_audio_file.wav
    

    Replace input_video_file.mp4 with the path to your video file, and output_audio_file.wav with the name you want for the output WAV file. This command converts the audio to a format (pcm_s16le codec with a sample rate of 16000 Hz) that should be compatible with the whisper software.

    Step 2: Translate the Audio

    Once you have your audio file, you can use the whisper software to translate the content from Japanese to English. Based on the guide you provided, here's how you could do it:

    1. Ensure you have followed the initial setup and compiled the software as per the initial commands given in your guide.
    2. Download the necessary translation model using the provided script, if you haven't already done so.
    3. Use the software with the -tr (translation) option and specify Japanese as the source language with -l ja.

    Here's how you could run the translation command:

    ./main -m models/ggml-base.en.bin -f output_audio_file.wav -tr -l ja
    

    Replace output_audio_file.wav with the name of the WAV file you obtained from step 1.

    This command tells the software to use the translation model (ggml-base.en.bin) to process the Japanese audio file and translate it into English.

    Notes:

    • Ensure that the path to the model (models/ggml-base.en.bin) and the audio file (output_audio_file.wav) is correct relative to where you're running the command from.
    • If your system requires different configurations or paths, adjust the commands accordingly.
    • This approach assumes the software can automatically translate audio content. Make sure the model you're using (ggml-base.en.bin) supports Japanese to English translation.

    Using the steps above, you should be able to translate Japanese audio from a video file into English text.