Spaces:
Configuration error
Configuration error
chore: use uv in start_server.sh and update docs (#49)
Browse files- Makefile +4 -5
- README.md +20 -4
- start_server.sh +1 -1
Makefile
CHANGED
@@ -65,13 +65,12 @@ md-lint: .md-lint ## Lint markdown files
|
|
65 |
.PHONY: py-Lint
|
66 |
py-lint: ## Lint Python files
|
67 |
$(ECHO_PREFIX) printf " %-12s ./...\n" "[PY LINT]"
|
68 |
-
$(CMD_PREFIX) if ! which
|
69 |
-
echo "Please install
|
70 |
-
echo "pip install poetry" ; \
|
71 |
exit 1 ; \
|
72 |
fi
|
73 |
-
$(CMD_PREFIX)
|
74 |
-
$(CMD_PREFIX)
|
75 |
|
76 |
.PHONY: run-docling-cpu
|
77 |
run-docling-cpu: ## Run the docling-serve container with CPU support and assign a container name
|
|
|
65 |
.PHONY: py-Lint
|
66 |
py-lint: ## Lint Python files
|
67 |
$(ECHO_PREFIX) printf " %-12s ./...\n" "[PY LINT]"
|
68 |
+
$(CMD_PREFIX) if ! which uv $(PIPE_DEV_NULL) ; then \
|
69 |
+
echo "Please install uv." ; \
|
|
|
70 |
exit 1 ; \
|
71 |
fi
|
72 |
+
$(CMD_PREFIX) uv sync --extra ui
|
73 |
+
$(CMD_PREFIX) uv run pre-commit run --all-files
|
74 |
|
75 |
.PHONY: run-docling-cpu
|
76 |
run-docling-cpu: ## Run the docling-serve container with CPU support and assign a container name
|
README.md
CHANGED
@@ -293,11 +293,11 @@ The response can be a JSON Document or a File.
|
|
293 |
### CPU only
|
294 |
|
295 |
```sh
|
296 |
-
# Install
|
297 |
-
curl -
|
298 |
|
299 |
# Install dependencies
|
300 |
-
|
301 |
```
|
302 |
|
303 |
### Cuda GPU
|
@@ -306,9 +306,25 @@ For GPU support use the following command:
|
|
306 |
|
307 |
```sh
|
308 |
# Install dependencies
|
309 |
-
|
310 |
```
|
311 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
### Run the server
|
313 |
|
314 |
The [start_server.sh](./start_server.sh) executable is a convenient script for launching the local webserver.
|
|
|
293 |
### CPU only
|
294 |
|
295 |
```sh
|
296 |
+
# Install uv if not already available
|
297 |
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
298 |
|
299 |
# Install dependencies
|
300 |
+
uv sync --extra cpu
|
301 |
```
|
302 |
|
303 |
### Cuda GPU
|
|
|
306 |
|
307 |
```sh
|
308 |
# Install dependencies
|
309 |
+
uv sync
|
310 |
```
|
311 |
|
312 |
+
### Gradio UI and different OCR backends
|
313 |
+
|
314 |
+
`/ui` endpoint using `gradio` and different OCR backends can be enabled via package extras:
|
315 |
+
|
316 |
+
```sh
|
317 |
+
# Enable ui and rapidocr
|
318 |
+
uv sync --extra ui --extra rapidocr
|
319 |
+
```
|
320 |
+
|
321 |
+
```sh
|
322 |
+
# Enable tesserocr
|
323 |
+
uv sync --extra tesserocr
|
324 |
+
```
|
325 |
+
|
326 |
+
See `[project.optional-dependencies]` section in `pyproject.toml` for full list of options.
|
327 |
+
|
328 |
### Run the server
|
329 |
|
330 |
The [start_server.sh](./start_server.sh) executable is a convenient script for launching the local webserver.
|
start_server.sh
CHANGED
@@ -21,7 +21,7 @@ if [ "$RELOAD" == "true" ]; then
|
|
21 |
fi
|
22 |
|
23 |
# Launch
|
24 |
-
exec
|
25 |
docling_serve.app:app \
|
26 |
--host=${HOST} \
|
27 |
--port=${PORT} \
|
|
|
21 |
fi
|
22 |
|
23 |
# Launch
|
24 |
+
exec uv run uvicorn \
|
25 |
docling_serve.app:app \
|
26 |
--host=${HOST} \
|
27 |
--port=${PORT} \
|