File size: 568 Bytes
b38be4c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import requests

# Define the URL of your deployed model endpoint
url = 'http://your-deployed-model-url/predict'

# Sample input data (replace this with your actual data)
data = {
    'data': [[5.1, 3.5, 1.4, 0.2], [6.3, 2.9, 5.6, 1.8]]
}

# Send POST request to the deployed model endpoint
response = requests.post(url, json=data)

# Check if request was successful
if response.status_code == 200:
    # Extract predictions from response
    predictions = response.json()['predictions']
    print("Predictions:", predictions)
else:
    print("Error:", response.text)