• Stefy Lanza (nextime / spora )'s avatar
    ocr: lang= is a real parameter now, and the default is auto-recognition (v0.3.23) · 2560d56b
    Stefy Lanza (nextime / spora ) authored
    /v1/ocr has accepted `lang` since the beginning, with the comment "reserved": it
    was parsed and dropped. A client asking for Italian got whatever the install was
    configured for and no way to tell.
    
    It is honoured now, on /v1/ocr, /v1/ocr/batch and the pipeline step, with
    precedence request > ocr.<engine>_lang > ocr.lang > auto. The request beats the
    engine-specific setting deliberately: that setting is an install's default, while
    a caller naming a language knows something about the document in hand. Asking for
    `auto` explicitly is NOT the same as sending nothing, so an install configured
    for Italian can still be asked to work it out.
    
    The default is auto-recognition rather than any particular language, because a
    server that has not been told what it is reading should not assume one. For
    surya-2, olmOCR and docTR that is simply what they already do: they are
    multilingual and have NO language input to constrain -- surya-2's entire prompt is
    "OCR this block image to HTML." and its own module warns the wording is the
    training-time contract, so there is nowhere to put a language and nothing to gain.
    Rather than let `lang` look effective everywhere, every response now carries what
    was applied AND whether the engine that served could act on it
    ("lang": "it", "lang_applied": false), and /v1/ocr/engines reports the same per
    engine so a client can choose before sending.
    
    PaddleOCR is the exception that shapes the rest. It loads a language-specific
    recognition model and its options are sent once at load, so an instance is built
    for one language and cannot be re-languaged. Hence: `auto` becomes
    ocr.paddle_auto_lang (default `latin`, a SCRIPT family rather than detection --
    PaddleOCR's own default is `ch`, a worse guess for most documents than no guess),
    and paddle gets one pool per language, keyed on the model it is BUILT with so
    `auto` and `latin` share a pool instead of loading it twice. The multilingual
    engines keep a single pool whatever is asked. That is not tidiness: a
    language-keyed pool is a second set of loaded instances holding VRAM, and a
    production install runs 24 surya instances. Both pool-iteration sites already use
    .values(), and _Pool keeps the plain engine name, so eviction and the VRAM
    releaser handle the new keys unchanged.
    
    ocr.lang's shipped default moves "it" -> "auto"; installs that set it explicitly
    (Digesta production does) are unaffected. ocr.surya_langs stays as the legacy
    setting it is -- it reaches only the <=0.17 recognition API and does nothing on
    the pod path.
    
    21 tests. The 8 failures in test_broker_config / test_studio_composed_surfaces /
    test_whisper_server_local_models are pre-existing, verified at HEAD.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01PxYHWbCAjjjD7A1rhFKtaW
    2560d56b
Name
Last commit
Last update
..
conftest.py Loading commit data...
test_admin_auth.py Loading commit data...
test_admin_forward_auth.py Loading commit data...
test_admin_remote_ui.py Loading commit data...
test_audio_ml_backends.py Loading commit data...
test_audio_ml_endpoints.py Loading commit data...
test_autoupgrade.py Loading commit data...
test_autoupgrade_recovers_a_down_server.py Loading commit data...
test_autoupgrade_sees_training.py Loading commit data...
test_broker_config.py Loading commit data...
test_broker_dispatch.py Loading commit data...
test_broker_protocol.py Loading commit data...
test_broker_shutdown.py Loading commit data...
test_broker_streaming.py Loading commit data...
test_burst_placement.py Loading commit data...
test_character_studio_fetch.py Loading commit data...
test_cluster.py Loading commit data...
test_compose.py Loading commit data...
test_forward_auth_peer_trust.py Loading commit data...
test_front_api_auth.py Loading commit data...
test_front_ocr_swap_gate.py Loading commit data...
test_image_has_c_compiler.py Loading commit data...
test_longcat_avatar_layout.py Loading commit data...
test_longcat_bsa.py Loading commit data...
test_longcat_cancellable.py Loading commit data...
test_longcat_checkpoint_resolve.py Loading commit data...
test_longcat_component_quant.py Loading commit data...
test_longcat_config_ui.py Loading commit data...
test_longcat_external_training.py Loading commit data...
test_longcat_int8_load.py Loading commit data...
test_longcat_lora.py Loading commit data...
test_longcat_orchestration.py Loading commit data...
test_longcat_packaging.py Loading commit data...
test_longcat_placement.py Loading commit data...
test_longcat_progress.py Loading commit data...
test_longcat_prompt_cache.py Loading commit data...
test_longcat_quantize.py Loading commit data...
test_longcat_scale.py Loading commit data...
test_longcat_tasks.py Loading commit data...
test_longcat_variants.py Loading commit data...
test_longcat_vendored_source.py Loading commit data...
test_longcat_venv_env.py Loading commit data...
test_longcat_vram_estimate.py Loading commit data...
test_longcat_worker.py Loading commit data...
test_manual_multimodal_test_client.py Loading commit data...
test_model_scan_cache.py Loading commit data...
test_ocr_fanout.py Loading commit data...
test_ocr_language.py Loading commit data...
test_ocr_olmocr.py Loading commit data...
test_ocr_served_model.py Loading commit data...
test_ocr_unreadable_and_dpi.py Loading commit data...
test_ocr_vram_share_and_fallback.py Loading commit data...
test_olmocr_pod_tls.py Loading commit data...
test_oom_priority.py Loading commit data...
test_pod_log_drain.py Loading commit data...
test_proxy_logprobs.py Loading commit data...
test_remote_execution.py Loading commit data...
test_runpod_client_scale.py Loading commit data...
test_runpod_fleet_status.py Loading commit data...
test_runpod_global_volume.py Loading commit data...
test_runpod_ocr_remotization.py Loading commit data...
test_runpod_placement.py Loading commit data...
test_runpod_pod_extra_args.py Loading commit data...
test_runpod_reaper_grace.py Loading commit data...
test_runpod_scale_down.py Loading commit data...
test_runpod_schedule_region_spend.py Loading commit data...
test_runpod_warmup.py Loading commit data...
test_studio_composed_surfaces.py Loading commit data...
test_surya_runpod_fixes.py Loading commit data...
test_township_api_key.py Loading commit data...
test_township_clip_geometry.py Loading commit data...
test_township_longcat.py Loading commit data...
test_township_page_js.py Loading commit data...
test_township_templates.py Loading commit data...
test_township_video_dataset.py Loading commit data...
test_upgrade_launcher.py Loading commit data...
test_video_as_b64_scope.py Loading commit data...
test_video_geometry.py Loading commit data...
test_vllm_share_self_tuning.py Loading commit data...
test_vram_releasers.py Loading commit data...
test_weight_stores.py Loading commit data...
test_whisper_server_local_models.py Loading commit data...