Spaces:
Running
Running
solving xsrf issue for uploading
Browse files- .streamlit/config.toml +3 -0
- Dockerfile +2 -1
.streamlit/config.toml
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[server]
|
| 2 |
+
# Required for file uploads on Hugging Face Spaces (iframe blocks XSRF cookies)
|
| 3 |
+
enableXsrfProtection = false
|
Dockerfile
CHANGED
|
@@ -21,6 +21,7 @@ RUN pip install --no-cache-dir torch torchvision --index-url https://download.py
|
|
| 21 |
|
| 22 |
# Copy app code (chown for HF Spaces permissions)
|
| 23 |
COPY --chown=user:user app.py predictor.py download_ckp.py ./
|
|
|
|
| 24 |
COPY --chown=user:user models/ models/
|
| 25 |
COPY --chown=user:user utils/ utils/
|
| 26 |
COPY --chown=user:user config/ config/
|
|
@@ -41,4 +42,4 @@ RUN chown -R user:user ckp
|
|
| 41 |
USER user
|
| 42 |
|
| 43 |
EXPOSE 8501
|
| 44 |
-
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
| 21 |
|
| 22 |
# Copy app code (chown for HF Spaces permissions)
|
| 23 |
COPY --chown=user:user app.py predictor.py download_ckp.py ./
|
| 24 |
+
COPY --chown=user:user .streamlit/ .streamlit/
|
| 25 |
COPY --chown=user:user models/ models/
|
| 26 |
COPY --chown=user:user utils/ utils/
|
| 27 |
COPY --chown=user:user config/ config/
|
|
|
|
| 42 |
USER user
|
| 43 |
|
| 44 |
EXPOSE 8501
|
| 45 |
+
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
|