Spaces:
Runtime error
Runtime error
File size: 976 Bytes
7ff1fe0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
#root_url="localhost:7860"
root_url="https://cetinca-fastapi-ep.hf.space"
ep="/"
url=$root_url$ep
data=''
response=$(curl --silent -X GET "$url" -H 'Content-Type: application/json')
echo "URL: $url"
echo "Data: $data"
echo "Response: $response"
echo
sleep 0.1
ep="/hello"
url=$root_url$ep
data='{"content":"Rori"}'
response=$(curl --silent -X POST "$url" -H 'Content-Type: application/json' -d "$data")
echo "URL: $url"
echo "Data: $data"
echo "Response: $response"
echo
sleep 0.5
ep="/sentiment-analysis"
url=$root_url$ep
data='{"content":"I am happy with it!"}'
response=$(curl --silent -X POST "$url" -H 'Content-Type: application/json' -d "$data")
echo "URL: $url"
echo "Data: $data"
echo "Response: $response"
echo
sleep 0.5
ep="/text2int"
url=$root_url$ep
data='{"content":"one hundred forty two"}'
response=$(curl --silent -X POST "$url" -H 'Content-Type: application/json' -d "$data")
echo "URL: $url"
echo "Data: $data"
echo "Response: $response"
echo
|