Spaces:
Sleeping
Sleeping
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) | |