Spaces:
Build error
Build error
Commit History
-
fix: wire 3 hardcoded AI models into the existing model_selector tiering (R-2/R-3/R-4)
Root cause: config/model_selector.py's get_model() (low/medium/high variants per task) has existed since Phase 31 but was called nowhere in the codebase -- confirmed via grep, zero call sites outside its own file and tests. Three consumers hardcoded a fixed model regardless of the machine's detected runtime_profile tier: - ai/nlp_extractor.py: always en_core_web_sm (get_model('ner')'s medium-tier value -- correct only by coincidence on medium tier) - ai/shadow_draft_detector.py: always all-MiniLM-L6-v2 (same coincidental medium-tier match) - processing/entity_resolver_v2.py: always paraphrase-multilingual-MiniLM-L12-v2 -- get_model('embeddings')'s HIGH-tier value, unconditionally, on every tier including 'low'. This is the most severe of the three: the 2GB-RAM 'low' tier -- the exact case runtime_profile.py exists to protect -- was loading the single heaviest embedding model available, every time. Trigger condition: always, independent of any misconfi…3066feb
-
feat(ai): complete — NLP pipeline all 4 modules confirmed working
Confirmed test results: - nlp_extractor: spaCy en_core_web_sm loaded, 11 entities from CAG sample 2 PERSON, 3 ORG, 2 MONEY, 2 GPE — all via spacy_ner - benfords_analyzer: Test 1 chi=4.30 NORMAL, Test 2 chi=4170 ANOMALY Logarithmic distribution correctly follows Benford expectation - shadow_draft_detector: all-MiniLM-L6-v2 loaded via sentence-transformers Test 1 semantic alignment 93.35 percent FLAGGED, Test 2 0.0 percent clear - multilingual_ner: switched from gated ai4bharat/IndicNER to public Davlan/bert-base-multilingual-cased-ner-hrl. Model extracted Hindi names via real NER: PER raajesh kumar, PER priyaa sharmaa confirmed English text correctly deferred to nlp_extractor spaCy pipelinea080734