Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -54,16 +54,11 @@ file = st.file_uploader("Upload CSV file", type=["csv"])
|
|
| 54 |
if file is not None:
|
| 55 |
if st.button("Predict for Batch", type='primary'):
|
| 56 |
try:
|
| 57 |
-
headers = {
|
| 58 |
-
# "Authorization": "Bearer YOUR_API_KEY", # Replace with actual API key if needed
|
| 59 |
-
"Content-Type": "multipart/form-data"
|
| 60 |
-
}
|
| 61 |
file_data = {"file": ("batch.csv", file.getvalue(), "text/csv")
|
| 62 |
}
|
| 63 |
response = requests.post(
|
| 64 |
"https://MainiSandeep1987-BackEndFlaskAPITelecomChurnPrediction.hf.space/v1/customerbatch",
|
| 65 |
-
files=file_data
|
| 66 |
-
headers=headers
|
| 67 |
)
|
| 68 |
|
| 69 |
response.raise_for_status() # Raise error if request fails
|
|
|
|
| 54 |
if file is not None:
|
| 55 |
if st.button("Predict for Batch", type='primary'):
|
| 56 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
file_data = {"file": ("batch.csv", file.getvalue(), "text/csv")
|
| 58 |
}
|
| 59 |
response = requests.post(
|
| 60 |
"https://MainiSandeep1987-BackEndFlaskAPITelecomChurnPrediction.hf.space/v1/customerbatch",
|
| 61 |
+
files=file_data
|
|
|
|
| 62 |
)
|
| 63 |
|
| 64 |
response.raise_for_status() # Raise error if request fails
|