Anthony Truchet commited on
Commit ·
c93b918
1
Parent(s): b7659bd
misc: report full traceback + env config
Browse files- Dockerfile +7 -3
- src/app.py +1 -1
Dockerfile
CHANGED
|
@@ -6,9 +6,13 @@ ARG APP_CODE=/app
|
|
| 6 |
ARG APP_DATA=/data/app
|
| 7 |
ARG HF_HOME=/data/huggingface
|
| 8 |
|
| 9 |
-
ENV APP_CODE
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
COPY ./requirements.txt $APP_CODE/requirements.txt
|
| 14 |
COPY ./packages.txt $APP_CODE/packages.txt
|
|
|
|
| 6 |
ARG APP_DATA=/data/app
|
| 7 |
ARG HF_HOME=/data/huggingface
|
| 8 |
|
| 9 |
+
ENV APP_CODE=$APP_CODE \
|
| 10 |
+
APP_DATA=$APP_DATA \
|
| 11 |
+
HF_HOME=$HF_HOME
|
| 12 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 13 |
+
SYSTEM=spaces \
|
| 14 |
+
SHELL=/bin/bash
|
| 15 |
+
|
| 16 |
|
| 17 |
COPY ./requirements.txt $APP_CODE/requirements.txt
|
| 18 |
COPY ./packages.txt $APP_CODE/packages.txt
|
src/app.py
CHANGED
|
@@ -20,7 +20,7 @@ def cached_download_csv(url : str, **kwargs) -> pd.DataFrame:
|
|
| 20 |
try:
|
| 21 |
s = shelve.open(shelf_filename, writeback=True, flag='c')
|
| 22 |
except Exception as exn:
|
| 23 |
-
st.warning("Unexpected exception, by-passing persistent cache :\n" +
|
| 24 |
return pd.read_csv(url, **kwargs)
|
| 25 |
with s as shelf:
|
| 26 |
st.info(f"Opened or created the shelf file '{shelf_filename}'")
|
|
|
|
| 20 |
try:
|
| 21 |
s = shelve.open(shelf_filename, writeback=True, flag='c')
|
| 22 |
except Exception as exn:
|
| 23 |
+
st.warning("Unexpected exception, by-passing persistent cache :\n" + exn.with_traceback())
|
| 24 |
return pd.read_csv(url, **kwargs)
|
| 25 |
with s as shelf:
|
| 26 |
st.info(f"Opened or created the shelf file '{shelf_filename}'")
|