Skip to content

Commit 50c0966

Browse files
artizclaude
andcommitted
fix(pdf): keep model_path behind the ml feature gate
The model-inventory insertion landed between model_path's #[cfg(feature = "ml")] attribute and the function it guarded, so the pdf-text (wasm) build started compiling model_path — which calls the ml-gated prefer_fp32 / resolve_asset — and CI's wasm32 job failed with E0425. Re-attach the gate (and the doc comment) to the function itself. Verified with CI's exact command: cargo check -p docling --no-default-features --features pdf-text --target wasm32-unknown-unknown --locked, plus the bare no-default-features wasm check, docling-wasm, the docling-pdf/serve suites, fmt and clippy. Signed-off-by: artiz <artem.kustikov@gmail.com> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EY5KAiquN4YpVf2PXEQkVT
1 parent b48dffd commit 50c0966

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

crates/docling-pdf/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,6 @@ pub(crate) fn resolve_asset(rel: &str) -> String {
232232
rel.to_string()
233233
}
234234

235-
#[cfg(feature = "ml")]
236-
/// Resolve a model path: an explicit env override always wins; otherwise the
237-
/// INT8 variant of the default path when it exists on disk (the quantized
238-
/// models are conformance-validated — see docs/PDF_CONFORMANCE.md — and load/run
239-
/// markedly faster on CPU), unless `DOCLING_RS_FP32` opts back into full
240-
/// precision; else the fp32 default.
241235
/// One resolved runtime asset — which file a stage would load right now,
242236
/// given the CWD, the env overrides and the int8/fp32 preference.
243237
#[cfg(feature = "ml")]
@@ -296,6 +290,12 @@ pub fn model_inventory() -> Vec<ModelEntry> {
296290
]
297291
}
298292

293+
/// Resolve a model path: an explicit env override always wins; otherwise the
294+
/// INT8 variant of the default path when it exists on disk (the quantized
295+
/// models are conformance-validated — see docs/PDF_CONFORMANCE.md — and load/run
296+
/// markedly faster on CPU), unless `DOCLING_RS_FP32` opts back into full
297+
/// precision; else the fp32 default.
298+
#[cfg(feature = "ml")]
299299
pub(crate) fn model_path(env: &str, fp32_default: &str, int8_default: &str) -> String {
300300
if let Ok(p) = std::env::var(env) {
301301
return p;

0 commit comments

Comments
 (0)