test / call.sh
tamdang1350's picture
Update call.sh
5fa3981 verified
Raw History Blame Contribute Delete
468 Bytes
#!/bin/bash
# Đổi thành URL Space của bạn
BASE_URL="https://tamdang1350-test.hf.space"
# Dùng: ./call.sh csv myfile.csv
# hoặc: ./call.sh json data.json
# hoặc: ./call.sh text notes.txt
TYPE=$1
FILE=$2
if [ -z "$TYPE" ] || [ -z "$FILE" ]; then
echo "Usage: ./call.sh [csv|json|text] <file_path>"
exit 1
fi
echo "Đang gửi $FILE lên server..."
curl -s -X POST "$BASE_URL/process/$TYPE" \
-F "file=@$FILE" \
| python3 -m json.tool