Update Dockerfile
Browse files- Dockerfile +17 -1
Dockerfile
CHANGED
|
@@ -12,7 +12,23 @@ WORKDIR /app
|
|
| 12 |
|
| 13 |
COPY . /app
|
| 14 |
|
| 15 |
-
RUN pip install --no-cache-dir PyYAML && pip install --no-cache-dir -e .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
EXPOSE 7860
|
| 18 |
|
|
|
|
| 12 |
|
| 13 |
COPY . /app
|
| 14 |
|
| 15 |
+
RUN pip install --no-cache-dir PyYAML mistralai && pip install --no-cache-dir -e . && \
|
| 16 |
+
python - <<'PY'
|
| 17 |
+
from pathlib import Path
|
| 18 |
+
|
| 19 |
+
path = Path("/app/cmbagent/utils/ocr.py")
|
| 20 |
+
text = path.read_text()
|
| 21 |
+
|
| 22 |
+
old = "from mistralai import Mistral, DocumentURLChunk"
|
| 23 |
+
new = """try:
|
| 24 |
+
from mistralai import Mistral, DocumentURLChunk
|
| 25 |
+
except Exception:
|
| 26 |
+
Mistral = None
|
| 27 |
+
DocumentURLChunk = None
|
| 28 |
+
"""
|
| 29 |
+
|
| 30 |
+
path.write_text(text.replace(old, new))
|
| 31 |
+
PY
|
| 32 |
|
| 33 |
EXPOSE 7860
|
| 34 |
|