Upload folder using huggingface_hub
Browse files- Dockerfile +2 -2
- app.py +3 -1
Dockerfile
CHANGED
|
@@ -10,7 +10,7 @@ COPY . .
|
|
| 10 |
# Install Python dependencies listed in requirements.txt
|
| 11 |
RUN pip3 install -r requirements.txt
|
| 12 |
|
| 13 |
-
# Define the command to run the Streamlit app on port
|
| 14 |
-
CMD ["streamlit", "run", "app.py", "--server.port=
|
| 15 |
|
| 16 |
# NOTE: Disable XSRF protection for easier external access in order to make batch predictions
|
|
|
|
| 10 |
# Install Python dependencies listed in requirements.txt
|
| 11 |
RUN pip3 install -r requirements.txt
|
| 12 |
|
| 13 |
+
# Define the command to run the Streamlit app on port 7860 and make it accessible externally
|
| 14 |
+
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
|
| 15 |
|
| 16 |
# NOTE: Disable XSRF protection for easier external access in order to make batch predictions
|
app.py
CHANGED
|
@@ -52,7 +52,9 @@ uploaded_file = st.file_uploader("Upload CSV file for batch prediction", type=["
|
|
| 52 |
# Make batch prediction when the "Predict Batch" button is clicked
|
| 53 |
if uploaded_file is not None:
|
| 54 |
if st.button("Predict Batch"):
|
| 55 |
-
response = requests.post("https://raj2809-superkartsalespredictionfrontend.hf.space/v1/superkartbatch", files={"file": uploaded_file
|
|
|
|
|
|
|
| 56 |
if response.status_code == 200:
|
| 57 |
predictions = response.json()
|
| 58 |
st.success("Batch predictions completed!")
|
|
|
|
| 52 |
# Make batch prediction when the "Predict Batch" button is clicked
|
| 53 |
if uploaded_file is not None:
|
| 54 |
if st.button("Predict Batch"):
|
| 55 |
+
response = requests.post("https://raj2809-superkartsalespredictionfrontend.hf.space/v1/superkartbatch", files={"file": (uploaded_file.name,uploaded_file.getvalue(),uploaded_file.type)}
|
| 56 |
+
}
|
| 57 |
+
# Send file to Flask API
|
| 58 |
if response.status_code == 200:
|
| 59 |
predictions = response.json()
|
| 60 |
st.success("Batch predictions completed!")
|