Spaces:
Runtime error
Runtime error
Update app.py
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://
|
| 36 |
if response.status_code == 200:
|
| 37 |
result = response.json()
|
| 38 |
churn_prediction = result["Churn expected?"] # 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://
|
| 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://rda9527-deployment-test-v2.hf.space/v1/customer", json=customer_data)
|
| 36 |
if response.status_code == 200:
|
| 37 |
result = response.json()
|
| 38 |
churn_prediction = result["Churn expected?"] # 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://rda9527-deployment-test-v2.hf.space/v1/customerbatch", files={"file": file})
|
| 50 |
if response.status_code == 200:
|
| 51 |
result = response.json()
|
| 52 |
st.header("Batch Prediction Results")
|