Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ import json
|
|
| 7 |
# Define the URL of your deployed backend API
|
| 8 |
# Replace with the actual URL of your Hugging Face Space endpoint
|
| 9 |
# The endpoint will typically be your_space_url/predict
|
| 10 |
-
BACKEND_API_URL = "https://huggingface.co/spaces/hareeshkumarkn/hareesh539/predict"
|
| 11 |
|
| 12 |
st.title("SuperKart Sales Prediction")
|
| 13 |
|
|
@@ -74,7 +74,7 @@ if st.button("Predict Sales"):
|
|
| 74 |
try:
|
| 75 |
# Send the data to the backend API
|
| 76 |
# Sending as a list containing the dictionary to potentially handle batch predictions in the future
|
| 77 |
-
response = requests.post(
|
| 78 |
|
| 79 |
if response.status_code == 200:
|
| 80 |
predictions = response.json().get('predictions')
|
|
|
|
| 7 |
# Define the URL of your deployed backend API
|
| 8 |
# Replace with the actual URL of your Hugging Face Space endpoint
|
| 9 |
# The endpoint will typically be your_space_url/predict
|
| 10 |
+
BACKEND_API_URL = "https://huggingface.co/spaces/hareeshkumarkn/hareesh539/predict" # Added quotes
|
| 11 |
|
| 12 |
st.title("SuperKart Sales Prediction")
|
| 13 |
|
|
|
|
| 74 |
try:
|
| 75 |
# Send the data to the backend API
|
| 76 |
# Sending as a list containing the dictionary to potentially handle batch predictions in the future
|
| 77 |
+
response = requests.post(BACKEND_API_URL, json=[input_data])
|
| 78 |
|
| 79 |
if response.status_code == 200:
|
| 80 |
predictions = response.json().get('predictions')
|