Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -48,8 +48,8 @@ input_data.drop("Store_Establishment_Year", axis=1, inplace=True)
|
|
| 48 |
# Make prediction when the "Predict" button is clicked
|
| 49 |
if st.button("Forecast"):
|
| 50 |
try:
|
| 51 |
-
response = requests.post("https://UncloudMe-SK_Sales_Backend.hf.space/
|
| 52 |
-
json=input_data.to_dict(orient='records')[0]
|
| 53 |
timeout=30 # add timeout for safety
|
| 54 |
)
|
| 55 |
|
|
@@ -84,7 +84,7 @@ uploaded_file = st.file_uploader("Upload CSV file for batch prediction", type=["
|
|
| 84 |
# Make batch prediction when the "Predict Batch" button is clicked
|
| 85 |
if uploaded_file is not None:
|
| 86 |
if st.button("Predict Batch"):
|
| 87 |
-
response = requests.post("https://UncloudMe-SK_Sales_Backend.hf.space/
|
| 88 |
if response.status_code == 200:
|
| 89 |
predictions = response.json()
|
| 90 |
st.success("Batch predictions completed!")
|
|
|
|
| 48 |
# Make prediction when the "Predict" button is clicked
|
| 49 |
if st.button("Forecast"):
|
| 50 |
try:
|
| 51 |
+
response = requests.post("https://UncloudMe-SK_Sales_Backend.hf.space/salespredict",
|
| 52 |
+
json=input_data.to_dict(orient='records')[0],
|
| 53 |
timeout=30 # add timeout for safety
|
| 54 |
)
|
| 55 |
|
|
|
|
| 84 |
# Make batch prediction when the "Predict Batch" button is clicked
|
| 85 |
if uploaded_file is not None:
|
| 86 |
if st.button("Predict Batch"):
|
| 87 |
+
response = requests.post("https://UncloudMe-SK_Sales_Backend.hf.space/salespredictbatch", files={"file": uploaded_file}) # Send file to Flask API
|
| 88 |
if response.status_code == 200:
|
| 89 |
predictions = response.json()
|
| 90 |
st.success("Batch predictions completed!")
|