Dattaluri commited on
Commit
83b29dd
·
verified ·
1 Parent(s): 7a9f7a6

Upload frontend app files

Browse files
https:/huggingface.co/spaces/Dattaluri/Great_Learning/app.py CHANGED
@@ -4,7 +4,7 @@ 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" # **Make sure this is the correct base URL of your backend Space**
9
 
10
  st.title("SuperKart Sales Forecast")
@@ -39,8 +39,8 @@ if st.button("Get Sales Forecast"):
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"https://huggingface.co/spaces/Dattaluri/Great_Learning/blob/main/app.py/predict", json=input_data)
44
  response.raise_for_status() # Raise an exception for bad status codes
45
 
46
  prediction = response.json()["prediction"][0]
 
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")
 
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
 
46
  prediction = response.json()["prediction"][0]