Spaces:
Runtime error
Runtime error
Upload frontend app files
Browse files
https:/huggingface.co/spaces/Dattaluri/Great_Learning/blob/main/app.py/app.py
CHANGED
|
@@ -4,8 +4,8 @@ import json
|
|
| 4 |
import pandas as pd
|
| 5 |
|
| 6 |
# Define the backend API endpoint URL
|
| 7 |
-
# Replace with the actual URL of your deployed backend API
|
| 8 |
-
BACKEND_API_URL = "https://huggingface.co/spaces/Dattaluri/Great_Learning"
|
| 9 |
|
| 10 |
st.title("SuperKart Sales Forecast")
|
| 11 |
|
|
@@ -39,6 +39,7 @@ if st.button("Get Sales Forecast"):
|
|
| 39 |
|
| 40 |
# Send the input data to the backend API for prediction
|
| 41 |
try:
|
|
|
|
| 42 |
response = requests.post(f"{BACKEND_API_URL}/predict", json=input_data)
|
| 43 |
response.raise_for_status() # Raise an exception for bad status codes
|
| 44 |
|
|
|
|
| 4 |
import pandas as pd
|
| 5 |
|
| 6 |
# Define the backend API endpoint URL
|
| 7 |
+
# Replace with the actual URL of your deployed backend API, starting with "https://"
|
| 8 |
+
BACKEND_API_URL = "https://huggingface.co/spaces/Dattaluri/Great_Learning" # **Make sure this is the correct base URL of your backend Space**
|
| 9 |
|
| 10 |
st.title("SuperKart Sales Forecast")
|
| 11 |
|
|
|
|
| 39 |
|
| 40 |
# Send the input data to the backend API for prediction
|
| 41 |
try:
|
| 42 |
+
# Use the BACKEND_API_URL variable in the f-string
|
| 43 |
response = requests.post(f"{BACKEND_API_URL}/predict", json=input_data)
|
| 44 |
response.raise_for_status() # Raise an exception for bad status codes
|
| 45 |
|