structverify 0.3.1__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {structverify-0.3.1/structverify.egg-info → structverify-0.3.2}/PKG-INFO +1 -1
- {structverify-0.3.1 → structverify-0.3.2}/pyproject.toml +1 -1
- {structverify-0.3.1 → structverify-0.3.2}/structverify/__init__.py +1 -1
- {structverify-0.3.1 → structverify-0.3.2}/structverify/training/monitor.py +40 -7
- {structverify-0.3.1 → structverify-0.3.2}/structverify/training/recipe/train_qlora.py +27 -3
- {structverify-0.3.1 → structverify-0.3.2/structverify.egg-info}/PKG-INFO +1 -1
- {structverify-0.3.1 → structverify-0.3.2}/LICENSE +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/README.md +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/setup.cfg +0 -0
- {structverify-0.3.1/structverify/verification → structverify-0.3.2/structverify/adaptation}/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/adaptation/adapter_trainer.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/adaptation/feedback_store.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/adaptation/kosis_crawler.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/adaptation/sample_builder.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/adaptation/synthetic_generator.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/adaptation/update_embeddings.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/builder_agent.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/conformance_agent.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/dependency_planner.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/indexing_agent.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/indexing_planner.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/integration_example.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/loop.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/memory.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/planner.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/prompts/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/prompts/planner_prompts.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/prompts/reflect_prompts.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/reflect.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/runtime_agent.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/schemas.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/source_profiler.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/tools/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/tools/base.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/tools/calculate.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/tools/catalog_search.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/tools/deep_explore.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/tools/explore_catalog.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/tools/fetch_evidence.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/tools/finish.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/tools/meta_explore.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/tools/query_rewriter.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/tools/read_original.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/tools/replan.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/agent/workspace.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/api.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/config/default.yaml +0 -0
- {structverify-0.3.1/structverify/utils → structverify-0.3.2/structverify/core}/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/core/config_loader.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/core/pipeline.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/core/schemas.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/_config.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/_llm.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/candidate/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/candidate/heuristic.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/candidate/llm.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/candidate_scorer.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/claim_detector.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/claims/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/claims/worthiness.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/domain/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/domain/classify.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/domain/preview.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/domain/registry.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/domain_classifier.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/prompts/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/prompts/candidate.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/prompts/claim_worthiness.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/prompts/domain.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/prompts/schema.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/prompts_loader.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/schema/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/schema/expand.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/schema/induce.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/schema/regenerate.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/schema/temporal_hints.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/schema/validate.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/schema_inductor.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/detection/synthetic_generator.py +0 -0
- {structverify-0.3.1/structverify/storage → structverify-0.3.2/structverify/explanation}/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/explanation/_config.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/explanation/_llm.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/explanation/explainer.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/explanation/fallback.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/explanation/formatters.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/explanation/prompts/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/explanation/prompts/match.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/explanation/prompts/mismatch.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/explanation/prompts/multihop.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/explanation/prompts/unverifiable.py +0 -0
- {structverify-0.3.1/structverify/retrieval → structverify-0.3.2/structverify/graph}/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/graph/claim_graph.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/graph/document_graph.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/graph/graph_builder.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/graph/graph_multihop.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/graph/graph_store.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/graph/provenance.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/memory/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/memory/agent_memory.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/memory/embedder.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/memory/exemplar_store.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/memory/normalizer.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/memory/schema.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/memory/storage/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/memory/storage/jsonl_store.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/memory/working_memory.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/Dockerfile.scraper +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/extractor.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/pdf/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/pdf/fields.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/pdf/markdown.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/pdf/models.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/pdf/ocr.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/pdf/pipeline.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/pdf/reader.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/pdf/scoring.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/scraper_sandbox.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/segmenter.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/preprocessing/sir_builder.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/progress.py +0 -0
- {structverify-0.3.1/structverify/graph → structverify-0.3.2/structverify/retrieval}/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/base.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/base_connector.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/catalog_ranker.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/catalog_search.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/chunking.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/custom_csv_source.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/custom_db_source.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/custom_docs_source.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/dimension_resolver.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/evidence_subgraph.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/kosis_connector.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/kosis_relevance.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/kosis_source.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/query_builder.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/registry.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/relevance_judge.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/retrieval/row_matcher.py +0 -0
- {structverify-0.3.1/structverify/explanation → structverify-0.3.2/structverify/storage}/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/storage/db_manager.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/storage/dwh_manager.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/storage/init_db.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/storage/raw_storage.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/training/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/training/curator.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/training/dataset.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/training/doctor.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/training/evalgate.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/training/generate.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/training/loop.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/training/recipe/sample.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/training/recipe/train_mlx.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/training/tasks.py +0 -0
- {structverify-0.3.1/structverify/core → structverify-0.3.2/structverify/utils}/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/utils/embedding_client.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/utils/llm_client.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/utils/logger.py +0 -0
- {structverify-0.3.1/structverify/adaptation → structverify-0.3.2/structverify/verification}/__init__.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/verification/_config.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/verification/adapters.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/verification/conformance.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/verification/decide_verdict.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/verification/decide_verdict_agent.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/verification/growth_diff.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/verification/row_match.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/verification/units.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/verification/verdict_thresholds.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify/verification/verifier.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify.egg-info/SOURCES.txt +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify.egg-info/dependency_links.txt +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify.egg-info/requires.txt +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/structverify.egg-info/top_level.txt +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_api.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_catalog_search_embedding.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_custom_csv_source.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_detection_candidate_heuristic.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_detection_config.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_detection_domain_preview.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_detection_domain_registry.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_detection_expand_temporal.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_detection_init_exports.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_detection_llm.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_detection_prompts_loader.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_detection_validate.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_detection_worthiness.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_embedding_client.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_embedding_config_threading.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_explore_catalog_embedding.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_is_table_relevant.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_kosis_crawler_embedding.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_kosis_guards.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_kosis_json_load_pgvector.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_library_entry_smoke.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_llm_client.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_pipeline.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_runtime_datasources.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_step1-9_v3_pipeline.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_step1_6_detection.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_step1_9_pipeline.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_step9_explainer.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_update_embeddings_embedding.py +0 -0
- {structverify-0.3.1 → structverify-0.3.2}/tests/test_verification_decide.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: structverify
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Compliance & fact verification for documents — check your files against your own rulebook (PDF) or a data source, and read a plain True/False.
|
|
5
5
|
Author-email: "김예슬 (Yeseul Kim)" <yesul0718@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "structverify"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.2"
|
|
4
4
|
description = "Compliance & fact verification for documents — check your files against your own rulebook (PDF) or a data source, and read a plain True/False."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = { file = "LICENSE" }
|
|
@@ -10,11 +10,34 @@
|
|
|
10
10
|
"""
|
|
11
11
|
from __future__ import annotations
|
|
12
12
|
|
|
13
|
+
import os
|
|
14
|
+
import sys
|
|
13
15
|
import time
|
|
14
16
|
from dataclasses import dataclass, field
|
|
15
17
|
|
|
16
18
|
_SPARK = "▁▂▃▄▅▆▇█"
|
|
17
19
|
|
|
20
|
+
# ── 터미널 색 (v0.3.2 팔레트) ────────────────────────────────────────────────
|
|
21
|
+
_ANSI = {"cyan": "\x1b[38;5;117m", "spark": "\x1b[38;5;111m", "dim": "\x1b[2m",
|
|
22
|
+
"bold": "\x1b[1m", "green": "\x1b[38;5;114m", "amber": "\x1b[38;5;179m",
|
|
23
|
+
"red": "\x1b[38;5;210m", "reset": "\x1b[0m"}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _color_enabled() -> bool:
|
|
27
|
+
"""NO_COLOR면 끔, SV_COLOR=1이면 강제 켬, 그 외엔 tty 감지."""
|
|
28
|
+
if os.environ.get("NO_COLOR"):
|
|
29
|
+
return False
|
|
30
|
+
if os.environ.get("SV_COLOR"):
|
|
31
|
+
return True
|
|
32
|
+
try:
|
|
33
|
+
return sys.stderr.isatty()
|
|
34
|
+
except Exception: # noqa: BLE001
|
|
35
|
+
return False
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _c(name: str, s: str, on: bool) -> str:
|
|
39
|
+
return f"{_ANSI[name]}{s}{_ANSI['reset']}" if on else s
|
|
40
|
+
|
|
18
41
|
|
|
19
42
|
def sparkline(values: list[float], width: int = 8) -> str:
|
|
20
43
|
"""최근 값들을 ▁▂▃ 스파크라인으로. 값이 없으면 빈 문자열."""
|
|
@@ -118,19 +141,29 @@ class LossMonitor:
|
|
|
118
141
|
|
|
119
142
|
# ── 터미널 UI ───────────────────────────────────────────────────────────
|
|
120
143
|
def render(self, max_steps: int, started_at: float, lr: float | None = None,
|
|
121
|
-
width: int = 12) -> str:
|
|
122
|
-
"""현재 상태를 터미널 한
|
|
144
|
+
width: int = 12, color: bool | None = None) -> str:
|
|
145
|
+
"""현재 상태를 터미널 한 줄로 (tty면 색 포함 — NO_COLOR/SV_COLOR로 제어)."""
|
|
146
|
+
on = _color_enabled() if color is None else color
|
|
123
147
|
frac = self.step / max_steps if max_steps else 0.0
|
|
124
148
|
filled = int(frac * width)
|
|
125
149
|
bar = "▓" * filled + "░" * (width - filled)
|
|
126
150
|
loss = self.losses[-1] if self.losses else float("nan")
|
|
127
151
|
spark = sparkline(self.means)
|
|
128
152
|
elapsed = time.time() - started_at
|
|
129
|
-
eta = _fmt_eta(elapsed / frac - elapsed) if frac > 0.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
153
|
+
eta = _fmt_eta(elapsed / frac - elapsed) if frac > 0.005 else "--:--"
|
|
154
|
+
st_color = ("red" if "발산" in self.status
|
|
155
|
+
else "amber" if self.status == "워밍업" else "green")
|
|
156
|
+
parts = [
|
|
157
|
+
"🧠 " + _c("cyan", f"{self.step}/{max_steps} {bar} {frac*100:3.0f}%", on),
|
|
158
|
+
_c("bold", f"loss {loss:.3f}", on) + " " + _c("spark", spark, on),
|
|
159
|
+
]
|
|
160
|
+
if lr:
|
|
161
|
+
parts.append(_c("dim", f"lr {lr:.1e}", on))
|
|
162
|
+
parts.append(_c("dim", f"ETA {eta}", on))
|
|
163
|
+
if self.spikes:
|
|
164
|
+
parts.append(_c("amber", f"⚡{len(self.spikes)}", on))
|
|
165
|
+
parts.append("🩺 " + _c(st_color, self.status, on))
|
|
166
|
+
return " · ".join(parts)
|
|
134
167
|
|
|
135
168
|
def summary(self) -> str:
|
|
136
169
|
"""학습 종료 시 요약 (레시피가 마지막에 출력)."""
|
|
@@ -26,6 +26,17 @@ os.environ.setdefault("TF_CPP_MIN_LOG_LEVEL", "3")
|
|
|
26
26
|
os.environ.setdefault("TRANSFORMERS_VERBOSITY", "error")
|
|
27
27
|
os.environ.setdefault("TOKENIZERS_PARALLELISM", "false")
|
|
28
28
|
|
|
29
|
+
# "Exception ignored in: <_io.BytesIO ...> BufferError" 도배 차단.
|
|
30
|
+
# Python 3.13 + datasets 멀티프로세스 토큰화의 무해한 정리 단계 잡음인데,
|
|
31
|
+
# 워커가 fork로 뜨면서 이 훅을 물려받아 자식 프로세스 출력까지 조용해진다.
|
|
32
|
+
sys.unraisablehook = lambda *_: None
|
|
33
|
+
|
|
34
|
+
import logging
|
|
35
|
+
import warnings
|
|
36
|
+
|
|
37
|
+
warnings.filterwarnings("ignore") # Flax deprecated 등
|
|
38
|
+
logging.getLogger("torchao").setLevel(logging.CRITICAL) # torchao .so 로드 WARNING
|
|
39
|
+
|
|
29
40
|
|
|
30
41
|
def load_chat_dataset(path):
|
|
31
42
|
from datasets import Dataset
|
|
@@ -65,6 +76,16 @@ def main():
|
|
|
65
76
|
from unsloth import FastLanguageModel
|
|
66
77
|
from trl import SFTTrainer, SFTConfig
|
|
67
78
|
|
|
79
|
+
# tqdm 진행바(체크포인트 로드·Map·Tokenizing) 대신 우리 phase 라인으로.
|
|
80
|
+
try:
|
|
81
|
+
import datasets as _ds
|
|
82
|
+
import transformers as _tf
|
|
83
|
+
_ds.disable_progress_bars()
|
|
84
|
+
_tf.utils.logging.disable_progress_bar()
|
|
85
|
+
except Exception: # noqa: BLE001
|
|
86
|
+
pass
|
|
87
|
+
|
|
88
|
+
print(f"⚙ 베이스 모델 로드 — {args.model} (4bit)", file=sys.stderr)
|
|
68
89
|
model, tokenizer = FastLanguageModel.from_pretrained(
|
|
69
90
|
model_name=args.model,
|
|
70
91
|
max_seq_length=args.seq_len,
|
|
@@ -81,6 +102,7 @@ def main():
|
|
|
81
102
|
use_gradient_checkpointing="unsloth",
|
|
82
103
|
)
|
|
83
104
|
|
|
105
|
+
print("⚙ 데이터 준비·토큰화 중 …", file=sys.stderr)
|
|
84
106
|
ds = load_chat_dataset(args.data)
|
|
85
107
|
|
|
86
108
|
def fmt(ex):
|
|
@@ -112,7 +134,7 @@ def main():
|
|
|
112
134
|
from transformers import TrainerCallback
|
|
113
135
|
from transformers.trainer_callback import PrinterCallback
|
|
114
136
|
|
|
115
|
-
from structverify.training.monitor import LossMonitor
|
|
137
|
+
from structverify.training.monitor import LossMonitor, _c, _color_enabled
|
|
116
138
|
|
|
117
139
|
class SVLiveCallback(TrainerCallback):
|
|
118
140
|
def __init__(self, early_stop: bool, patience: int):
|
|
@@ -128,18 +150,20 @@ def main():
|
|
|
128
150
|
print("\r\x1b[2K" + line, end="", flush=True, file=sys.stderr)
|
|
129
151
|
if self.mon.should_stop and self.early_stop:
|
|
130
152
|
print("", file=sys.stderr)
|
|
131
|
-
print(f"✂ {self.mon.stop_reason}", file=sys.stderr)
|
|
153
|
+
print(_c("amber", f"✂ {self.mon.stop_reason}", _color_enabled()), file=sys.stderr)
|
|
132
154
|
control.should_training_stop = True
|
|
133
155
|
return control
|
|
134
156
|
|
|
135
157
|
def on_train_end(self, targs, state, control, **kw):
|
|
136
158
|
print("", file=sys.stderr)
|
|
137
|
-
print(self.mon.summary(), file=sys.stderr)
|
|
159
|
+
print(_c("green", self.mon.summary(), _color_enabled()), file=sys.stderr)
|
|
138
160
|
return control
|
|
139
161
|
|
|
140
162
|
trainer.remove_callback(PrinterCallback) # {'loss': ...} dict 도배 제거
|
|
141
163
|
trainer.add_callback(SVLiveCallback(args.early_stop, args.patience))
|
|
142
164
|
|
|
165
|
+
es = "ON" if args.early_stop else "OFF (관찰만)"
|
|
166
|
+
print(f"🩺 실시간 감독 시작 — patience {args.patience} · 조기 종료 {es}", file=sys.stderr)
|
|
143
167
|
trainer.train()
|
|
144
168
|
|
|
145
169
|
# 어댑터 + trainer_state.json 저장 (TrainDoctor가 읽음)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: structverify
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Compliance & fact verification for documents — check your files against your own rulebook (PDF) or a data source, and read a plain True/False.
|
|
5
5
|
Author-email: "김예슬 (Yeseul Kim)" <yesul0718@gmail.com>
|
|
6
6
|
License: MIT License
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{structverify-0.3.1 → structverify-0.3.2}/structverify/detection/prompts/claim_worthiness.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{structverify-0.3.1/structverify/storage → structverify-0.3.2/structverify/explanation}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{structverify-0.3.1/structverify/retrieval → structverify-0.3.2/structverify/graph}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{structverify-0.3.1/structverify/graph → structverify-0.3.2/structverify/retrieval}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{structverify-0.3.1/structverify/explanation → structverify-0.3.2/structverify/storage}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|