File size: 754 Bytes
7aa2125
 
6f5baa5
 
7aa2125
6f5baa5
7aa2125
 
 
 
 
 
 
 
6f5baa5
7aa2125
 
6f5baa5
 
 
 
 
 
 
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
import requests

# Replace with your actual Hugging Face Spaces URL
url = "https://sushanadhikari-orreryspaceapp.hf.space/predict"

# Sample input data based on the features used in your model
data = {
    "absolute_magnitude_h": 22.1,
    "estimated_diameter_min_km": 0.127,
    "estimated_diameter_max_km": 0.285,
    "relative_velocity_km_per_sec": 5.67,
    "miss_distance_km": 386000.0
}

# Make a POST request to the API
response = requests.post(url, json=data)

# Check if the request was successful
if response.status_code == 200:
    # Print the model's prediction
    print("Response from the model:", response.json())
else:
    print(f"Failed to get a response, status code: {response.status_code}")
    print("Error details:", response.text)