Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -39,7 +39,7 @@ input_data = pd.DataFrame([{
|
|
| 39 |
|
| 40 |
# Make prediction when the "Predict" button is clicked
|
| 41 |
if st.button("Predict", type='primary'):
|
| 42 |
-
response = requests.post("https://karora1804
|
| 43 |
if response.status_code == 200:
|
| 44 |
prediction = response.json()['Predicted Total Sales:']
|
| 45 |
st.success(f"Predicted Store Total Sales: {prediction}")
|
|
@@ -55,7 +55,7 @@ uploaded_file = st.file_uploader("Upload CSV file for batch prediction", type=["
|
|
| 55 |
# Make batch prediction when the "Predict Batch" button is clicked
|
| 56 |
if uploaded_file is not None:
|
| 57 |
if st.button("Predict Batch"):
|
| 58 |
-
response = requests.post("https://karora1804
|
| 59 |
if response.status_code == 200:
|
| 60 |
predictions = response.json()
|
| 61 |
st.success("Batch predictions completed!")
|
|
|
|
| 39 |
|
| 40 |
# Make prediction when the "Predict" button is clicked
|
| 41 |
if st.button("Predict", type='primary'):
|
| 42 |
+
response = requests.post("https://karora1804-StoreTotalSalesPredictionBackend.hf.space/v1/storeSales", json=input_data.to_dict(orient='records')[0]) # Send data to Flask API
|
| 43 |
if response.status_code == 200:
|
| 44 |
prediction = response.json()['Predicted Total Sales:']
|
| 45 |
st.success(f"Predicted Store Total Sales: {prediction}")
|
|
|
|
| 55 |
# Make batch prediction when the "Predict Batch" button is clicked
|
| 56 |
if uploaded_file is not None:
|
| 57 |
if st.button("Predict Batch"):
|
| 58 |
+
response = requests.post("https://karora1804-StoreTotalSalesPredictionBackend.hf.space/v1/storeSalesbatch", files={"file": uploaded_file}) # Send file to Flask API
|
| 59 |
if response.status_code == 200:
|
| 60 |
predictions = response.json()
|
| 61 |
st.success("Batch predictions completed!")
|