Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- Dockerfile +16 -0
- app.py +1 -1
- requirements.txt +3 -1
Dockerfile
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a minimal base image with Python 3.9 installed
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# Set the working directory inside the container to /app
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy all files from the current directory on the host to the container's /app directory
|
| 8 |
+
COPY . .
|
| 9 |
+
|
| 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 8501 and make it accessible externally
|
| 14 |
+
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--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
|
@@ -30,7 +30,7 @@ product_data = {
|
|
| 30 |
}
|
| 31 |
|
| 32 |
if st.button("Predict", type='primary'):
|
| 33 |
-
response = requests.post("https://aenewton42-SuperKart.hf.space/v1/predict", json=product_data)
|
| 34 |
if response.status_code == 200:
|
| 35 |
result = response.json()
|
| 36 |
predicted_sales = result["Sales"]
|
|
|
|
| 30 |
}
|
| 31 |
|
| 32 |
if st.button("Predict", type='primary'):
|
| 33 |
+
response = requests.post("https://aenewton42-SuperKart.hf.space/v1/predict", json=product_data)
|
| 34 |
if response.status_code == 200:
|
| 35 |
result = response.json()
|
| 36 |
predicted_sales = result["Sales"]
|
requirements.txt
CHANGED
|
@@ -1 +1,3 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
pandas==2.2.2
|
| 2 |
+
requests==2.28.1
|
| 3 |
+
streamlit==1.43.2
|