Spaces:
Paused
Paused
Commit History
-
fix(vlm): _clean_json returns first complete JSON object, not brace span
find('{')..rfind('}') spans two emitted objects (e.g. an example then the answer) and fails the caller's json.loads. Use JSONDecoder().raw_decode to take the first complete object; fall back to the brace span on decode error. Takes effect live only after a Space redeploy (scripts/sync_spaces.ps1). Not CI-unit-testable: the module eager-loads the model at import. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>6341d31
-
feat(vlm): Step 8c-ii — opencv deskew preprocessing for scanned images
_preprocess_image() added to spaces/vlm/app.py: - Converts image to grayscale + Otsu threshold to isolate content - Runs HoughLinesP to estimate dominant skew angle - Rotates by the median angle (only corrects 0.5°–45° to avoid false positives) - Falls back to original image silently on any error (ZeroGPU safety) opencv-python-headless added to requirements.txt (headless avoids pulling in GTK/Qt display libs that are unnecessary and bloat the Space image). Improves extraction accuracy on scanned POs and hand-marked engineering drawings that arrive slightly tilted from phone cameras or flatbed scanners. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>7f5b7cf
-
feat(vlm): pivot to Qwen3-VL-8B-Instruct (bf16) off the broken FP8 path
Qwen3.6-35B-A3B-FP8 loads but its deep-gemm FP8 kernel rejects the checkpoint's recipe on the current ZeroGPU image (torch2.11/cu130) — unfixable via our config, and Qwen3.5-FP8 shares the path. Per user decision, pivot to a quant needing no special kernels: Qwen3-VL-8B-Instruct in bf16 (~16 GB, fits 48 GB easily; mainline qwen3_vl arch, no trust_remote_code, no FP8/AWQ kernels). Same unified apply_chat_template path; dropped `kernels` from requirements; duration 120->90 (8B loads fast). Capability-upgrade path noted in code: Qwen3-VL-30B-A3B-AWQ if Step-6 evals show 8B too weak on drawings (accepts AWQ-kernel risk). README §4 / PLAN updates deferred until the live smoke test confirms this model actually runs on ZeroGPU. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>b5ebcc6 -
fix(vlm): pin kernels<0.14 for deep-gemm FP8 metadata compatibility (attempt)
With `kernels` (0.14.1) installed, the VLM loads and reaches RUNNING but the first inference raises mid-forward: ValueError: Cannot parse metadata from .../kernels-community--deep-gemm/.../ torch211-cxx11-cu130-x86_64-linux/metadata.json: missing field `name` kernels 0.14 requires a `name` field in the kernel build's metadata.json that the current deep-gemm build lacks. transformers' DeepGEMM->Triton fallback only catches availability errors, not this parse ValueError, so it escapes. Pinning kernels<0.14 (=> 0.13.0) parses the older metadata schema. Informed but unverified — if it still fails, the VLM FP8 path is blocked on an upstream kernels/deep-gemm incompatibility on the current ZeroGPU image (torch 2.11/cu130) and needs a different fix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>13fc62c -
fix(vlm): add `kernels` for Qwen3.6 fine-grained FP8 inference
VLM Space loaded and reached RUNNING, but the first inference call raised mid-forward: ImportError: finegrained-fp8 kernel requires the `kernels` package. Qwen3.6-35B-A3B-FP8's FP8 linear layers lazy-load their kernel from HF's `kernels` package inside generate() — so it loads fine but fails on the first GPU call. Added `kernels` to the VLM requirements (not extract; NuExtract3 is bf16). Extract Space already passes a live Pydantic-valid round-trip. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>6c8719b -
fix(spaces): add torchvision — Qwen3-VL processor hard-requires it
Both Spaces crashed at startup (APP_STARTING -> RUNTIME_ERROR) on AutoProcessor.from_pretrained: ImportError: Qwen3VLVideoProcessor requires the Torchvision library The Qwen3-VL processor family (used by both Qwen3.6-35B-A3B-FP8 and NuExtract3, both qwen3_5 VL) imports torchvision unconditionally via its video sub-processor, even though we only pass images/text. torch is preinstalled in the ZeroGPU base image but torchvision is not. Added torchvision (unpinned) to both requirements.txt; this reverts the earlier "omit to avoid a version fight" call, which was wrong — it's a mandatory dep. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>d5c881b -
feat(spaces): Step 3 — VLM + Extract Space app.py, prompts shipped in core
Both ZeroGPU Spaces now run the contract core.clients expects: predict(prompt, schema_json, image_path) -> clean JSON string at /predict. - hitech-vlm: Qwen3.6-35B-A3B-FP8 via AutoModelForImageTextToText, eager module-scope load, @spaces.GPU(duration=120), torch_dtype="auto", enable_thinking=False, greedy decode, max_new_tokens=3072. Handles image+text and text-only. - hitech-extract: NuExtract3 (bf16), @spaces.GPU(duration=90), schema_json passed through as NuExtract's `template`. Handles image+text and text-only. - Each Space strips <think>/fences/prose to a clean JSON object so clients.py's json.loads never burns the single retry on a stray character. - requirements.txt: dropped `spaces` (platform pins it) and `gradio` (sdk base image provides it); pinned transformers>=4.57. README frontmatter: dropped sdk_version, added python_version "3.12". Prompts relocated INTO the package (core/src/hitech_ai_core/prompts/<app>/v1.md) so they ship in the wheel for git-subdirecto…dfdf5e5 -
docs+scaffold: collapse to 2 Spaces, adopt Qwen3.6/NuExtract3
Model research (live HF Hub) revised the architecture: - Qwen3.5+ is natively multimodal, so one model serves vision AND text. Dropped the 3rd hitech-text Space (HF Space deleted). - hitech-vlm -> Qwen/Qwen3.6-35B-A3B-FP8 (multimodal MoE, 36B/3B active, ~36GB) handles drawings/scanned POs/photos + summaries/Q&A/classification. Fallback Qwen3.5-35B-A3B-FP8 (same arch, more field-tested). - hitech-extract -> numind/NuExtract3 (base, 4.5B) confirmed newest + category-leading structured-extraction model; routes the cheap high-frequency PO/spec extraction off the 36B VLM. Updated README §4/§7/§9/§10/§11, PLAN (scope/Step1/Step3/decisions), CLAUDE.md architecture, sync script (2 spaces), removed spaces/text/. Build note: VLM needs @spaces.GPU(duration=120) for first-call load. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>cb5bcfd -
feat: scaffold repo layout — Step 1 complete
Full directory tree, core/ src-layout package, three Space stubs (vlm/extract/text), prompt/eval/supabase/scripts placeholders, git identity set to jaisonshah/jaisonshah99@gmail.com. HF namespace confirmed as HiTech-Mem; ZeroGPU large = 48 GB RTX Pro 6000 Blackwell; Python 3.12; GPU size via @spaces.GPU decorator only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>dcbbddb