Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -32,7 +32,7 @@ customer_data = {
|
|
| 32 |
}
|
| 33 |
|
| 34 |
if st.button("Predict", type='primary'):
|
| 35 |
-
response = requests.post("https://aenewton42-
|
| 36 |
if response.status_code == 200:
|
| 37 |
result = response.json()
|
| 38 |
churn_prediction = result["Prediction"] # Extract only the value
|
|
@@ -46,7 +46,7 @@ st.subheader("Batch Prediction")
|
|
| 46 |
file = st.file_uploader("Upload CSV file", type=["csv"])
|
| 47 |
if file is not None:
|
| 48 |
if st.button("Predict for Batch", type='primary'):
|
| 49 |
-
response = requests.post("https://aenewton42-
|
| 50 |
if response.status_code == 200:
|
| 51 |
result = response.json()
|
| 52 |
st.header("Batch Prediction Results")
|
|
|
|
| 32 |
}
|
| 33 |
|
| 34 |
if st.button("Predict", type='primary'):
|
| 35 |
+
response = requests.post("https://aenewton42-flaskbackendchurn.hf.space/v1/customer", json=customer_data) # enter user name and space name before running the cell
|
| 36 |
if response.status_code == 200:
|
| 37 |
result = response.json()
|
| 38 |
churn_prediction = result["Prediction"] # Extract only the value
|
|
|
|
| 46 |
file = st.file_uploader("Upload CSV file", type=["csv"])
|
| 47 |
if file is not None:
|
| 48 |
if st.button("Predict for Batch", type='primary'):
|
| 49 |
+
response = requests.post("https://aenewton42-flaskbackendchurn.hf.space/v1/customerbatch", files={"file": file}) # enter user name and space name before running the cell
|
| 50 |
if response.status_code == 200:
|
| 51 |
result = response.json()
|
| 52 |
st.header("Batch Prediction Results")
|