fix: use port 7860 for HF Spaces, add src/streamlit_app.py entrypoint
Browse files- Dockerfile +3 -3
- src/streamlit_app.py +9 -0
Dockerfile
CHANGED
|
@@ -17,8 +17,8 @@ ENV LORA_ADAPTER_PATH=Tyycha/qwen-coder-pauq-lora
|
|
| 17 |
ENV BASE_MODEL_NAME=Qwen/Qwen2.5-Coder-3B-Instruct
|
| 18 |
ENV DEVICE=cpu
|
| 19 |
|
| 20 |
-
EXPOSE
|
| 21 |
|
| 22 |
-
HEALTHCHECK CMD curl --fail http://localhost:
|
| 23 |
|
| 24 |
-
ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=
|
|
|
|
| 17 |
ENV BASE_MODEL_NAME=Qwen/Qwen2.5-Coder-3B-Instruct
|
| 18 |
ENV DEVICE=cpu
|
| 19 |
|
| 20 |
+
EXPOSE 7860
|
| 21 |
|
| 22 |
+
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
|
| 23 |
|
| 24 |
+
ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
src/streamlit_app.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import sys
|
| 3 |
+
|
| 4 |
+
# Запускаем основное приложение из корня проекта
|
| 5 |
+
root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
| 6 |
+
os.chdir(root)
|
| 7 |
+
sys.path.insert(0, root)
|
| 8 |
+
|
| 9 |
+
exec(open(os.path.join(root, "streamlit_app.py")).read())
|