pathScripts/asr copy

22 lines
449 B
Bash
Executable file

#!/bin/bash
# Check if a filename is provided
if [ "$#" -ne 1 ]; then
echo "Usage: $0 filename"
exit 1
fi
# Assign the first argument to FILENAME
FILENAME="$1"
# Check if the file exists
if [ ! -f "$FILENAME" ]; then
echo "Error: File not found - $FILENAME"
exit 1
fi
# Perform the curl POST request with the file
curl -X POST http://127.0.0.1:3456/v1/asr \
-H 'Authorization: bearer sk-NhrtQwCHNdK5sRZC' \
-F "file=@$FILENAME"