structverify 0.3.2__tar.gz → 0.3.3__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.2/structverify.egg-info → structverify-0.3.3}/PKG-INFO +1 -1
- {structverify-0.3.2 → structverify-0.3.3}/pyproject.toml +1 -1
- {structverify-0.3.2 → structverify-0.3.3}/structverify/__init__.py +1 -1
- {structverify-0.3.2 → structverify-0.3.3}/structverify/training/loop.py +5 -1
- {structverify-0.3.2 → structverify-0.3.3}/structverify/training/recipe/sample.py +24 -5
- {structverify-0.3.2 → structverify-0.3.3}/structverify/training/recipe/train_qlora.py +47 -23
- {structverify-0.3.2 → structverify-0.3.3/structverify.egg-info}/PKG-INFO +1 -1
- {structverify-0.3.2 → structverify-0.3.3}/LICENSE +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/README.md +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/setup.cfg +0 -0
- {structverify-0.3.2/structverify/verification → structverify-0.3.3/structverify/adaptation}/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/adaptation/adapter_trainer.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/adaptation/feedback_store.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/adaptation/kosis_crawler.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/adaptation/sample_builder.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/adaptation/synthetic_generator.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/adaptation/update_embeddings.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/builder_agent.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/conformance_agent.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/dependency_planner.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/indexing_agent.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/indexing_planner.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/integration_example.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/loop.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/memory.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/planner.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/prompts/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/prompts/planner_prompts.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/prompts/reflect_prompts.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/reflect.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/runtime_agent.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/schemas.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/source_profiler.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/tools/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/tools/base.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/tools/calculate.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/tools/catalog_search.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/tools/deep_explore.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/tools/explore_catalog.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/tools/fetch_evidence.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/tools/finish.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/tools/meta_explore.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/tools/query_rewriter.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/tools/read_original.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/tools/replan.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/agent/workspace.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/api.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/config/default.yaml +0 -0
- {structverify-0.3.2/structverify/utils → structverify-0.3.3/structverify/core}/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/core/config_loader.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/core/pipeline.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/core/schemas.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/_config.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/_llm.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/candidate/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/candidate/heuristic.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/candidate/llm.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/candidate_scorer.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/claim_detector.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/claims/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/claims/worthiness.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/domain/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/domain/classify.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/domain/preview.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/domain/registry.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/domain_classifier.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/prompts/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/prompts/candidate.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/prompts/claim_worthiness.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/prompts/domain.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/prompts/schema.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/prompts_loader.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/schema/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/schema/expand.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/schema/induce.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/schema/regenerate.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/schema/temporal_hints.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/schema/validate.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/schema_inductor.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/detection/synthetic_generator.py +0 -0
- {structverify-0.3.2/structverify/storage → structverify-0.3.3/structverify/explanation}/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/explanation/_config.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/explanation/_llm.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/explanation/explainer.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/explanation/fallback.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/explanation/formatters.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/explanation/prompts/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/explanation/prompts/match.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/explanation/prompts/mismatch.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/explanation/prompts/multihop.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/explanation/prompts/unverifiable.py +0 -0
- {structverify-0.3.2/structverify/retrieval → structverify-0.3.3/structverify/graph}/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/graph/claim_graph.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/graph/document_graph.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/graph/graph_builder.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/graph/graph_multihop.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/graph/graph_store.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/graph/provenance.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/memory/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/memory/agent_memory.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/memory/embedder.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/memory/exemplar_store.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/memory/normalizer.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/memory/schema.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/memory/storage/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/memory/storage/jsonl_store.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/memory/working_memory.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/Dockerfile.scraper +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/extractor.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/pdf/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/pdf/fields.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/pdf/markdown.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/pdf/models.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/pdf/ocr.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/pdf/pipeline.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/pdf/reader.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/pdf/scoring.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/scraper_sandbox.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/segmenter.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/preprocessing/sir_builder.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/progress.py +0 -0
- {structverify-0.3.2/structverify/graph → structverify-0.3.3/structverify/retrieval}/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/base.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/base_connector.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/catalog_ranker.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/catalog_search.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/chunking.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/custom_csv_source.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/custom_db_source.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/custom_docs_source.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/dimension_resolver.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/evidence_subgraph.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/kosis_connector.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/kosis_relevance.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/kosis_source.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/query_builder.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/registry.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/relevance_judge.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/retrieval/row_matcher.py +0 -0
- {structverify-0.3.2/structverify/explanation → structverify-0.3.3/structverify/storage}/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/storage/db_manager.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/storage/dwh_manager.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/storage/init_db.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/storage/raw_storage.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/training/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/training/curator.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/training/dataset.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/training/doctor.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/training/evalgate.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/training/generate.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/training/monitor.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/training/recipe/train_mlx.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/training/tasks.py +0 -0
- {structverify-0.3.2/structverify/core → structverify-0.3.3/structverify/utils}/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/utils/embedding_client.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/utils/llm_client.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/utils/logger.py +0 -0
- {structverify-0.3.2/structverify/adaptation → structverify-0.3.3/structverify/verification}/__init__.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/verification/_config.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/verification/adapters.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/verification/conformance.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/verification/decide_verdict.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/verification/decide_verdict_agent.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/verification/growth_diff.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/verification/row_match.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/verification/units.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/verification/verdict_thresholds.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify/verification/verifier.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify.egg-info/SOURCES.txt +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify.egg-info/dependency_links.txt +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify.egg-info/requires.txt +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/structverify.egg-info/top_level.txt +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_api.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_catalog_search_embedding.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_custom_csv_source.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_detection_candidate_heuristic.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_detection_config.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_detection_domain_preview.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_detection_domain_registry.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_detection_expand_temporal.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_detection_init_exports.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_detection_llm.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_detection_prompts_loader.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_detection_validate.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_detection_worthiness.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_embedding_client.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_embedding_config_threading.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_explore_catalog_embedding.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_is_table_relevant.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_kosis_crawler_embedding.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_kosis_guards.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_kosis_json_load_pgvector.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_library_entry_smoke.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_llm_client.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_pipeline.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_runtime_datasources.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_step1-9_v3_pipeline.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_step1_6_detection.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_step1_9_pipeline.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_step9_explainer.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/tests/test_update_embeddings_embedding.py +0 -0
- {structverify-0.3.2 → structverify-0.3.3}/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.3
|
|
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.3"
|
|
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" }
|
|
@@ -96,7 +96,11 @@ class LearningLoop:
|
|
|
96
96
|
print(" " + info["command"])
|
|
97
97
|
return info
|
|
98
98
|
try:
|
|
99
|
-
|
|
99
|
+
# 백엔드 존재 확인 — torch 등 무거운 import가 뿜는 잡음(torchao·Flax)은 숨긴다.
|
|
100
|
+
import contextlib
|
|
101
|
+
with open(os.devnull, "w") as _dn, \
|
|
102
|
+
contextlib.redirect_stdout(_dn), contextlib.redirect_stderr(_dn):
|
|
103
|
+
__import__(_probe)
|
|
100
104
|
except Exception: # noqa: BLE001
|
|
101
105
|
raise RuntimeError(f"run=True에는 학습 백엔드가 필요합니다 → {need}. "
|
|
102
106
|
"또는 run=False로 명령만 받아 별도 실행하세요.")
|
|
@@ -9,10 +9,27 @@ GPU 머신(어댑터 학습한 곳)에서 실행:
|
|
|
9
9
|
--task schema --claim "당사 물류 파트너는 2,300개사에 달했습니다."
|
|
10
10
|
"""
|
|
11
11
|
import argparse
|
|
12
|
+
import contextlib
|
|
13
|
+
import logging
|
|
12
14
|
import os
|
|
15
|
+
import sys
|
|
16
|
+
import warnings
|
|
13
17
|
|
|
14
18
|
os.environ.setdefault("TF_CPP_MIN_LOG_LEVEL", "3")
|
|
15
19
|
os.environ.setdefault("TRANSFORMERS_VERBOSITY", "error")
|
|
20
|
+
sys.unraisablehook = lambda *_: None
|
|
21
|
+
warnings.filterwarnings("ignore")
|
|
22
|
+
logging.getLogger("torchao").setLevel(logging.CRITICAL)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@contextlib.contextmanager
|
|
26
|
+
def _quiet():
|
|
27
|
+
if os.environ.get("SV_VERBOSE"):
|
|
28
|
+
yield
|
|
29
|
+
return
|
|
30
|
+
with open(os.devnull, "w") as dn, \
|
|
31
|
+
contextlib.redirect_stdout(dn), contextlib.redirect_stderr(dn):
|
|
32
|
+
yield
|
|
16
33
|
|
|
17
34
|
# 내장 테스트 — 시드/증강 데이터에 없는 새 표현으로 일반화를 확인.
|
|
18
35
|
_DEFAULT_TESTS = [
|
|
@@ -37,7 +54,8 @@ def main():
|
|
|
37
54
|
ap.add_argument("--max-tokens", type=int, default=120)
|
|
38
55
|
args = ap.parse_args()
|
|
39
56
|
|
|
40
|
-
|
|
57
|
+
with _quiet():
|
|
58
|
+
from unsloth import FastLanguageModel
|
|
41
59
|
|
|
42
60
|
from structverify.training.tasks import build_example
|
|
43
61
|
|
|
@@ -49,10 +67,11 @@ def main():
|
|
|
49
67
|
else:
|
|
50
68
|
tests = _DEFAULT_TESTS
|
|
51
69
|
|
|
52
|
-
print(f"어댑터
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
70
|
+
print(f"⚙ 어댑터 로드 — {args.adapter}")
|
|
71
|
+
with _quiet():
|
|
72
|
+
model, tok = FastLanguageModel.from_pretrained(
|
|
73
|
+
args.adapter, max_seq_length=2048, load_in_4bit=True)
|
|
74
|
+
FastLanguageModel.for_inference(model)
|
|
56
75
|
|
|
57
76
|
for t in tests:
|
|
58
77
|
msgs = build_example(**t)["messages"][:2] # system + user만
|
|
@@ -31,6 +31,7 @@ os.environ.setdefault("TOKENIZERS_PARALLELISM", "false")
|
|
|
31
31
|
# 워커가 fork로 뜨면서 이 훅을 물려받아 자식 프로세스 출력까지 조용해진다.
|
|
32
32
|
sys.unraisablehook = lambda *_: None
|
|
33
33
|
|
|
34
|
+
import contextlib
|
|
34
35
|
import logging
|
|
35
36
|
import warnings
|
|
36
37
|
|
|
@@ -38,6 +39,17 @@ warnings.filterwarnings("ignore") # Flax deprecated 등
|
|
|
38
39
|
logging.getLogger("torchao").setLevel(logging.CRITICAL) # torchao .so 로드 WARNING
|
|
39
40
|
|
|
40
41
|
|
|
42
|
+
@contextlib.contextmanager
|
|
43
|
+
def _quiet():
|
|
44
|
+
"""서드파티 import·로드가 뿜는 무관한 출력 숨김. SV_VERBOSE=1이면 전부 표시."""
|
|
45
|
+
if os.environ.get("SV_VERBOSE"):
|
|
46
|
+
yield
|
|
47
|
+
return
|
|
48
|
+
with open(os.devnull, "w") as dn, \
|
|
49
|
+
contextlib.redirect_stdout(dn), contextlib.redirect_stderr(dn):
|
|
50
|
+
yield
|
|
51
|
+
|
|
52
|
+
|
|
41
53
|
def load_chat_dataset(path):
|
|
42
54
|
from datasets import Dataset
|
|
43
55
|
rows = []
|
|
@@ -72,35 +84,47 @@ def main():
|
|
|
72
84
|
help="중간 체크포인트(checkpoint-*) 보존 — 기본은 성공 시 삭제 (어댑터만 수십 MB)")
|
|
73
85
|
args = ap.parse_args()
|
|
74
86
|
|
|
75
|
-
# unsloth: 3060/T4에서 QLoRA 2배 빠름 + 메모리
|
|
76
|
-
|
|
77
|
-
|
|
87
|
+
# unsloth: 3060/T4에서 QLoRA 2배 빠름 + 메모리 절약.
|
|
88
|
+
# import·로드 단계의 배너·경고는 숨기고(_quiet) 우리 요약 한 줄로 대체.
|
|
89
|
+
with _quiet():
|
|
90
|
+
from unsloth import FastLanguageModel
|
|
91
|
+
from trl import SFTTrainer, SFTConfig
|
|
92
|
+
|
|
93
|
+
# tqdm 진행바(체크포인트 로드·Map·Tokenizing) 대신 우리 phase 라인으로.
|
|
94
|
+
try:
|
|
95
|
+
import datasets as _ds
|
|
96
|
+
import transformers as _tf
|
|
97
|
+
_ds.disable_progress_bars()
|
|
98
|
+
_tf.utils.logging.disable_progress_bar()
|
|
99
|
+
except Exception: # noqa: BLE001
|
|
100
|
+
pass
|
|
78
101
|
|
|
79
|
-
# tqdm 진행바(체크포인트 로드·Map·Tokenizing) 대신 우리 phase 라인으로.
|
|
80
102
|
try:
|
|
81
|
-
import
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
103
|
+
import torch
|
|
104
|
+
_p = torch.cuda.get_device_properties(0)
|
|
105
|
+
_prec = "bf16" if torch.cuda.is_bf16_supported() else "fp16"
|
|
106
|
+
print(f"⚙ 학습 엔진 준비 — unsloth · {_p.name} ({_p.total_memory/2**30:.0f}GB) · {_prec}",
|
|
107
|
+
file=sys.stderr)
|
|
85
108
|
except Exception: # noqa: BLE001
|
|
86
109
|
pass
|
|
87
110
|
|
|
88
111
|
print(f"⚙ 베이스 모델 로드 — {args.model} (4bit)", file=sys.stderr)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
model
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
112
|
+
with _quiet():
|
|
113
|
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
|
114
|
+
model_name=args.model,
|
|
115
|
+
max_seq_length=args.seq_len,
|
|
116
|
+
load_in_4bit=True, # QLoRA — 12GB VRAM에 7B 적재
|
|
117
|
+
)
|
|
118
|
+
model = FastLanguageModel.get_peft_model(
|
|
119
|
+
model,
|
|
120
|
+
r=args.rank,
|
|
121
|
+
target_modules=["q_proj", "k_proj", "v_proj", "o_proj",
|
|
122
|
+
"gate_proj", "up_proj", "down_proj"],
|
|
123
|
+
lora_alpha=args.rank * 2,
|
|
124
|
+
lora_dropout=0.0,
|
|
125
|
+
bias="none",
|
|
126
|
+
use_gradient_checkpointing="unsloth",
|
|
127
|
+
)
|
|
104
128
|
|
|
105
129
|
print("⚙ 데이터 준비·토큰화 중 …", file=sys.stderr)
|
|
106
130
|
ds = load_chat_dataset(args.data)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: structverify
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.3
|
|
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.2 → structverify-0.3.3}/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.2/structverify/storage → structverify-0.3.3/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.2/structverify/retrieval → structverify-0.3.3/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.2/structverify/graph → structverify-0.3.3/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.2/structverify/explanation → structverify-0.3.3/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
|