Dattaluri commited on
Commit
4de65a0
·
verified ·
1 Parent(s): 17765cd

Upload frontend app files

Browse files
https:/huggingface.co/spaces/Dattaluri/Great_Learning/app.py CHANGED
@@ -5,7 +5,7 @@ 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
 
 
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" # **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
+ # Corrected f-string syntax to use the BACKEND_API_URL variable
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