- _generate_one_stream: streams responses, optional live repeat-loop detection (abort) that closes the stream early and flags the partial result as repeat=True so the existing retry loop re-runs with higher temperature - _should_retry honors result.repeat; stream_mode threaded through both first attempt and retry calls in chat_completions_batch - GenerationResult.repeat field; SURYA_STREAM_MODE setting (default off) - diagnostic retry logs (reason=repeat|error|detected, temp) - docker-compose: SURYA_STREAM_MODE=off, 4090 GPU profile, logs volume - logger.yaml: TimedRotatingFileHandler for error handler (fixes startup crash without maxBytes)
39 lines
1.1 KiB
YAML
39 lines
1.1 KiB
YAML
services:
|
|
surya-ocr:
|
|
build: .
|
|
container_name: surya-ocr
|
|
runtime: nvidia
|
|
environment:
|
|
- VLLM_DTYPE=bfloat16
|
|
- VLLM_GPU_TYPE=4090
|
|
- VLLM_MAX_NUM_SEQS=32
|
|
- VLLM_MAX_BATCHED_TOKENS=8192
|
|
- SURYA_INFERENCE_MAX_INFLIGHT=32
|
|
# "off" | "on" | "abort" — streaming mode for chat completions
|
|
- SURYA_STREAM_MODE=off
|
|
- NVIDIA_VISIBLE_DEVICES=all
|
|
ports:
|
|
- "5002:5002"
|
|
volumes:
|
|
- ~/.cache/huggingface:/root/.cache/huggingface
|
|
- ./logs:/opt/suya-ocr/logs
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.surya-ocr.rule=Host(`ocr.kzbrd.ru`)"
|
|
- "traefik.http.routers.surya-ocr.entrypoints=websecure"
|
|
- "traefik.http.routers.surya-ocr.tls.certresolver=myresolver"
|
|
- "traefik.http.services.surya-ocr.loadbalancer.server.port=5002"
|
|
networks:
|
|
- traefik_proxy
|
|
|
|
networks:
|
|
traefik_proxy:
|
|
external: true
|