Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -58,13 +58,12 @@ if file is not None:
|
|
| 58 |
# "Authorization": "Bearer YOUR_API_KEY", # Replace with actual API key if needed
|
| 59 |
"Content-Type": "multipart/form-data"
|
| 60 |
}
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
response = requests.post(
|
| 64 |
"https://MainiSandeep1987-BackEndFlaskAPITelecomChurnPrediction.hf.space/v1/customerbatch",
|
| 65 |
files=file_data,
|
| 66 |
headers=headers
|
| 67 |
-
|
| 68 |
|
| 69 |
##response = requests.post("https://MainiSandeep1987-BackEndFlaskAPITelecomChurnPrediction.hf.space/v1/customerbatch", files={"file": file.getvalue()}) # enter user name and space name before running the cell
|
| 70 |
if response.status_code == 200:
|
|
|
|
| 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")} # Properly format file
|
| 62 |
+
response = requests.post(
|
|
|
|
| 63 |
"https://MainiSandeep1987-BackEndFlaskAPITelecomChurnPrediction.hf.space/v1/customerbatch",
|
| 64 |
files=file_data,
|
| 65 |
headers=headers
|
| 66 |
+
)
|
| 67 |
|
| 68 |
##response = requests.post("https://MainiSandeep1987-BackEndFlaskAPITelecomChurnPrediction.hf.space/v1/customerbatch", files={"file": file.getvalue()}) # enter user name and space name before running the cell
|
| 69 |
if response.status_code == 200:
|