Spaces:
Running
on
T4
Running
on
T4
Commit
·
fc79b68
1
Parent(s):
d5eecf2
Spaces: remove Dockerfile, guard Streamlit execution to avoid bare-mode
Browse files- Dockerfile +0 -9
- app.py +2 -3
Dockerfile
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
FROM pytorch/pytorch:latest
|
| 2 |
-
|
| 3 |
-
WORKDIR /app
|
| 4 |
-
|
| 5 |
-
COPY . .
|
| 6 |
-
|
| 7 |
-
RUN pip install -r requirements.txt
|
| 8 |
-
|
| 9 |
-
CMD [ "streamlit", "run", "app.py" ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
|
@@ -139,7 +139,6 @@ def run_streamlit_ui():
|
|
| 139 |
"upload then remove the artifacts.")
|
| 140 |
|
| 141 |
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
# So keep a safe guard for direct execution as well
|
| 145 |
run_streamlit_ui()
|
|
|
|
| 139 |
"upload then remove the artifacts.")
|
| 140 |
|
| 141 |
|
| 142 |
+
# Only run when executed by Streamlit runner
|
| 143 |
+
if getattr(st, "runtime", None) and st.runtime.exists():
|
|
|
|
| 144 |
run_streamlit_ui()
|