Skip to content

Commit

Permalink
bench-wts.sh : rename script + add execute permission
Browse files Browse the repository at this point in the history
  • Loading branch information
ggerganov committed Mar 6, 2023
1 parent b597c5a commit bb6b54a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions extra/qual-bench.sh → extra/bench-wts.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Benchmark word-level timestamps for different models
#
# This script takes two arguments
# - an audio file
# - [optional] path to a font file
# - [optional] path to a font file

# I'm using "/usr/share/fonts/truetype/freefont/FreeMono.ttf" on Ubuntu

Expand All @@ -10,16 +12,17 @@ if [ -z "$1" ]; then
fi

#TODO: Make this a command line parameter
models="base small large"
#models="base small large"
#models="tiny.en tiny base.en base small.en small medium.en medium large-v1 large"
models="tiny.en base.en small.en medium.en large"

DURATION=$(ffprobe -i $1 -show_entries format=duration -v quiet -of csv="p=0")
DURATION=$(printf "%.2f" $DURATION)
echo "Input file duration: ${DURATION}s"

for model in $models; do
echo "Running $model"
COMMAND="./main -m models/ggml-$model.bin -owts -f $1 -of $1.$model"
COMMAND="./main -m models/ggml-$model.bin -owts -f $1 -of $1.$model"

if [ ! -z "$2" ]; then
COMMAND="$COMMAND -fp $2"
Expand All @@ -40,7 +43,7 @@ for model in $models; do

# If the file already exists, delete it
if [ -f $1.mp4 ]; then
rm $1.$model.mp4
rm $1.mp4
fi

bash $1.$model.wts >/dev/null 2>&1
Expand All @@ -64,4 +67,4 @@ COMMAND="$COMMAND vstack=inputs=${COUNT}[v]\" -map \"[v]\" -map 1:a $1.all.mp4 >
echo $COMMAND

# Run the command
eval $COMMAND
eval $COMMAND

0 comments on commit bb6b54a

Please sign in to comment.