Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -77,7 +77,7 @@ input_data = pd.DataFrame([{
|
|
| 77 |
if st.button("Predict"):
|
| 78 |
print(input_data.to_dict(orient='records')[0])
|
| 79 |
# Send the input data to the Flask API for prediction
|
| 80 |
-
response = requests.post("https://anithajk-
|
| 81 |
if response.status_code == 200:
|
| 82 |
prediction = response.json()['Predicted Revenue (in dollars)']
|
| 83 |
st.success(f"Predicted Revenue (in dollars): {prediction}")
|
|
@@ -93,7 +93,7 @@ uploaded_file = st.file_uploader("Upload CSV file for batch prediction", type=["
|
|
| 93 |
# Make batch prediction when the "Predict Batch" button is clicked
|
| 94 |
if uploaded_file is not None:
|
| 95 |
if st.button("Predict Batch"):
|
| 96 |
-
response = requests.post("https://anithajk-
|
| 97 |
if response.status_code == 200:
|
| 98 |
predictions = response.json()
|
| 99 |
st.success("Batch predictions completed!")
|
|
|
|
| 77 |
if st.button("Predict"):
|
| 78 |
print(input_data.to_dict(orient='records')[0])
|
| 79 |
# Send the input data to the Flask API for prediction
|
| 80 |
+
response = requests.post("https://anithajk-SuperKartDecesionMakingModelBackend.hf.space/v1/productsale", json=input_data.to_dict(orient='records')[0]) # Send data to Flask API
|
| 81 |
if response.status_code == 200:
|
| 82 |
prediction = response.json()['Predicted Revenue (in dollars)']
|
| 83 |
st.success(f"Predicted Revenue (in dollars): {prediction}")
|
|
|
|
| 93 |
# Make batch prediction when the "Predict Batch" button is clicked
|
| 94 |
if uploaded_file is not None:
|
| 95 |
if st.button("Predict Batch"):
|
| 96 |
+
response = requests.post("https://anithajk-SuperKartDecesionMakingModelBackend.hf.space/v1/productsalebatch", files={"file": uploaded_file}) # Send file to Flask API
|
| 97 |
if response.status_code == 200:
|
| 98 |
predictions = response.json()
|
| 99 |
st.success("Batch predictions completed!")
|