Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -37,7 +37,7 @@ input_data={'Product_Weight':Product_Weight,
|
|
| 37 |
# Logic for prediction of single record.
|
| 38 |
|
| 39 |
if st.button('Predict',type='primary'):
|
| 40 |
-
response=requests.post('https://siddhesh1981-
|
| 41 |
if response.status_code==200:
|
| 42 |
result=response.json()
|
| 43 |
prediction=result['prediction']
|
|
@@ -52,7 +52,7 @@ st.subheader("Batch Prediction")
|
|
| 52 |
file2=st.file_uploader('Upload CSV File',type=['csv'])
|
| 53 |
if file2 is not None:
|
| 54 |
if st.button("Predict for Batch", type='primary'):
|
| 55 |
-
response=requests.post('https://siddhesh1981-
|
| 56 |
if response.status_code==200:
|
| 57 |
result=response.json()
|
| 58 |
st.header("Batch Prediction Results")
|
|
|
|
| 37 |
# Logic for prediction of single record.
|
| 38 |
|
| 39 |
if st.button('Predict',type='primary'):
|
| 40 |
+
response=requests.post('https://siddhesh1981-Backendapi.hf.space/v1/data',json=input_data)
|
| 41 |
if response.status_code==200:
|
| 42 |
result=response.json()
|
| 43 |
prediction=result['prediction']
|
|
|
|
| 52 |
file2=st.file_uploader('Upload CSV File',type=['csv'])
|
| 53 |
if file2 is not None:
|
| 54 |
if st.button("Predict for Batch", type='primary'):
|
| 55 |
+
response=requests.post('https://siddhesh1981-Backendapi.hf.space/v1/databatch',files={'file':file2})
|
| 56 |
if response.status_code==200:
|
| 57 |
result=response.json()
|
| 58 |
st.header("Batch Prediction Results")
|