wisent 0.5.1__tar.gz → 0.5.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.
Potentially problematic release.
This version of wisent might be problematic. Click here for more details.
- {wisent-0.5.1 → wisent-0.5.2}/PKG-INFO +1 -1
- wisent-0.5.2/wisent/__init__.py +1 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/metrics/evaluator.py +16 -16
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/output_sanitizer/cpp_sanitizer.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/output_sanitizer/java_sanitizer.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/output_sanitizer/python_sanitizer.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/safe_docker/core/runtime.py +4 -4
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/safe_docker/entrypoint.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/safe_docker/recipes.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/classifiers/models/logistic.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/classifiers/models/mlp.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/classifiers/classifier_rotator.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/data_loaders/data_loader_rotator.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/evaluators/evaluator_rotator.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/steering_methods/steering_rotator.py +3 -3
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/wisent_cli/commands/help_cmd.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/wisent_cli/commands/listing.py +7 -7
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/wisent_cli/commands/train_cmd.py +15 -15
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/wisent_cli/main.py +7 -7
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/wisent_cli/shell.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/wisent_cli/util/aggregations.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/__init__.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/activations/activations_collector.py +5 -5
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/device_benchmarks.py +9 -9
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/diagnose/classifier_marketplace.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/diagnose/create_classifier.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/diagnose/response_diagnostics.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/diagnose/synthetic_classifier_option.py +6 -6
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/diagnose/test_synthetic_classifier.py +3 -3
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/diagnose.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/autonomous_agent.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/core/atoms.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/core/buliders.py +3 -3
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/core/pair.py +4 -4
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/core/response.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/core/serialization.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/core/set.py +3 -3
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/diagnostics/control_vectors.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/lm_eval_pairs/atoms.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/lm_eval_pairs/lm_extractor_registry.py +4 -4
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/winogrande.py +4 -4
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_pairs_generation.py +3 -3
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/data_loaders/core/atoms.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/data_loaders/loaders/custom.py +3 -3
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/data_loaders/loaders/lm_loader.py +4 -4
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/download_full_benchmarks.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/evaluators/oracles/interactive.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/evaluators/oracles/nlp_evaluator.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/evaluators/oracles/user_specified.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/lm_eval_harness_ground_truth.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/log_likelihoods_evaluator.py +4 -4
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/models/core/atoms.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/models/wisent_model.py +5 -5
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/optuna/__init__.py +3 -3
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/optuna/classifier/activation_generator.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/optuna/classifier/classifier_cache.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/optuna/classifier/optuna_classifier_optimizer.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/optuna/steering/bigcode_evaluator_wrapper.py +3 -3
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/optuna/steering/data_utils.py +3 -3
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/optuna/steering/metrics.py +5 -5
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/optuna/steering/optuna_pipeline.py +8 -8
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/optuna/steering/steering_optimization.py +9 -9
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/prompts/core/prompt_formater.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/prompts/prompt_stratiegies/direct_completion.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/prompts/prompt_stratiegies/instruction_following.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/prompts/prompt_stratiegies/multiple_choice.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/prompts/prompt_stratiegies/role_playing.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/sample_size_optimizer.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/steering.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/steering_methods/core/atoms.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/steering_methods/methods/caa.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/steering_optimizer.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tracking/memory.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/trainers/core/atoms.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/trainers/steering_trainer.py +7 -7
- {wisent-0.5.1 → wisent-0.5.2}/wisent/opti/methods/opti_classificator.py +5 -5
- {wisent-0.5.1 → wisent-0.5.2}/wisent/opti/methods/opti_steering.py +5 -5
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/cleaners/core/atoms.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/cleaners/deduper_cleaner.py +4 -4
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/cleaners/methods/base_dedupers.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/cleaners/methods/base_refusalers.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/cleaners/methods/core/atoms.py +2 -2
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/cleaners/pairs_cleaner.py +10 -10
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/cleaners/refusaler_cleaner.py +12 -12
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/db_instructions/mini_dp.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/generators/diversities/methods/fast_diversity.py +1 -1
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/generators/pairs_generator.py +8 -8
- {wisent-0.5.1 → wisent-0.5.2}/wisent.egg-info/PKG-INFO +1 -1
- wisent-0.5.1/wisent/__init__.py +0 -1
- {wisent-0.5.1 → wisent-0.5.2}/LICENSE +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/README.md +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/pyproject.toml +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/setup.cfg +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/setup.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/metrics/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/metrics/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/metrics/core/atoms.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/metrics/passk.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/output_sanitizer/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/output_sanitizer/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/output_sanitizer/core/atoms.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/output_sanitizer/utils.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/providers/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/providers/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/providers/core/atoms.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/providers/livecodebench/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/providers/livecodebench/provider.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/safe_docker/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/safe_docker/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/benchmarks/coding/safe_docker/core/atoms.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/classifiers/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/classifiers/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/classifiers/core/atoms.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/classifiers/models/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/classifiers/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/cli_logger.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/data_loaders/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/evaluators/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/steering_methods/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/wisent_cli/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/wisent_cli/commands/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/wisent_cli/ui.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/wisent_cli/util/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/wisent_cli/util/parsing.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/cli/wisent_cli/version.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/activations/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/activations/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/activations/core/atoms.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/budget.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/diagnose/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/diagnose/agent_classifier_decision.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/diagnose/select_classifiers.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/diagnose/tasks/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/diagnose/tasks/task_manager.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/diagnose/tasks/task_relevance.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/diagnose/tasks/task_selector.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/steer.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/agent/timeout.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/bigcode_integration.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/diagnostics/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/diagnostics/activations.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/diagnostics/base.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/diagnostics/coverage.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/diagnostics/divergence.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/diagnostics/duplicates.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/lm_eval_pairs/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/lm_eval_pairs/lm_extractor_manifest.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/contrastive_pairs/lm_eval_pairs/lm_task_extractors/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/data_loaders/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/data_loaders/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/data_loaders/loaders/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/detection_handling.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/evaluators/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/evaluators/oracles/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/hyperparameter_optimizer.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/managed_cached_benchmarks.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/mixed_benchmark_sampler.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/model_config_manager.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/model_persistence.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/models/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/models/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/multi_steering.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/optuna/classifier/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/optuna/steering/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/parser.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/prompts/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/prompts/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/prompts/core/atom.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/prompts/prompt_stratiegies/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/representation.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/sample_size_optimizer_v2.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/save_results.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/steering_method.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/steering_methods/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/steering_methods/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/steering_methods/methods/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/task_interface.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/task_selector.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tasks/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tasks/aime_task.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tasks/file_task.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tasks/hle_task.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tasks/hmmt_task.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tasks/livecodebench_task.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tasks/livemathbench_task.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tasks/lm_eval_task.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tasks/math500_task.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tasks/polymath_task.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tasks/supergpqa_task.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/time_estimator.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/timing_calibration.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tracking/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/tracking/latency.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/trainers/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/trainers/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/core/user_model_config.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/opti/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/opti/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/opti/core/atoms.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/opti/methods/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/cleaners/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/cleaners/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/cleaners/methods/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/cleaners/methods/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/db_instructions/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/db_instructions/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/db_instructions/core/atoms.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/generators/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/generators/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/generators/core/atoms.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/generators/diversities/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/generators/diversities/core/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/generators/diversities/core/core.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent/synthetic/generators/diversities/methods/__init__.py +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent.egg-info/SOURCES.txt +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent.egg-info/dependency_links.txt +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent.egg-info/requires.txt +0 -0
- {wisent-0.5.1 → wisent-0.5.2}/wisent.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.5.2"
|
|
@@ -2,19 +2,19 @@ from __future__ import annotations
|
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
from typing import Callable, Iterable, Optional, TYPE_CHECKING
|
|
4
4
|
|
|
5
|
-
from
|
|
6
|
-
from
|
|
7
|
-
from
|
|
5
|
+
from wisent.benchmarks.coding.safe_docker.core.runtime import DockerSandboxExecutor
|
|
6
|
+
from wisent.benchmarks.coding.safe_docker.recipes import RECIPE_REGISTRY
|
|
7
|
+
from wisent.benchmarks.coding.metrics.core.atoms import SampleOutcome, Evaluator
|
|
8
8
|
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
12
|
-
from
|
|
9
|
+
from wisent.benchmarks.coding.output_sanitizer.core.atoms import TaskSchema
|
|
10
|
+
from wisent.benchmarks.coding.output_sanitizer.python_sanitizer import PythonStandardizer
|
|
11
|
+
from wisent.benchmarks.coding.output_sanitizer.cpp_sanitizer import CppStandardizer
|
|
12
|
+
from wisent.benchmarks.coding.output_sanitizer.java_sanitizer import JavaStandardizer
|
|
13
13
|
|
|
14
14
|
if TYPE_CHECKING:
|
|
15
|
-
from
|
|
16
|
-
from
|
|
17
|
-
from
|
|
15
|
+
from wisent.benchmarks.coding.safe_docker.core.atoms import Result
|
|
16
|
+
from wisent.benchmarks.coding.providers.core.atoms import Provider, CodingTask
|
|
17
|
+
from wisent.benchmarks.coding.output_sanitizer.core.atoms import CodeStandardizer
|
|
18
18
|
|
|
19
19
|
RepairFn = Callable[[str, dict[str,str], str], dict[str,str]]
|
|
20
20
|
|
|
@@ -82,7 +82,7 @@ def _make_schema(task: CodingTask) -> TaskSchema:
|
|
|
82
82
|
and allow_wrapper set appropriately.
|
|
83
83
|
|
|
84
84
|
example:
|
|
85
|
-
>>> from
|
|
85
|
+
>>> from wisent.benchmarks.coding.providers.core.atoms import CodingTask
|
|
86
86
|
>>> task = CodingTask(language="python", files={}, options={"entry_point":"add","file_name":"my_solution.py"})
|
|
87
87
|
>>> schema = _make_schema(task)
|
|
88
88
|
>>> schema.language
|
|
@@ -128,7 +128,7 @@ class CodingEvaluator(Evaluator):
|
|
|
128
128
|
Feedback string summarizing the result, truncated to cfg.feedback_max_chars.
|
|
129
129
|
|
|
130
130
|
examples:
|
|
131
|
-
>>> from
|
|
131
|
+
>>> from wisent.benchmarks.coding.safe_docker.core.atoms import Result
|
|
132
132
|
>>> res = Result(status="timeout", stdout="", stderr="", elapsed=10.0)
|
|
133
133
|
>>> evaluator = CodingEvaluator(provider=None, model_fn=lambda x: {}, cfg=EvaluatorConfig())
|
|
134
134
|
>>> evaluator._feedback(res)
|
|
@@ -163,8 +163,8 @@ class CodingEvaluator(Evaluator):
|
|
|
163
163
|
Result object containing the status, stdout, stderr, and elapsed time.
|
|
164
164
|
|
|
165
165
|
examples:
|
|
166
|
-
>>> from
|
|
167
|
-
>>> from
|
|
166
|
+
>>> from wisent.benchmarks.coding.providers.core.atoms import CodingTask
|
|
167
|
+
>>> from wisent.benchmarks.coding.safe_docker.core.atoms import Result
|
|
168
168
|
>>> task = CodingTask(language="python", files={}, options={})
|
|
169
169
|
>>> files = {"solution.py": "def add(a,b): return a + b", "tests.py": "from solution import add\ndef test_ok(): assert add(1,2)==3"}
|
|
170
170
|
>>> evaluator = CodingEvaluator(provider=None, model_fn=lambda x: {})
|
|
@@ -201,7 +201,7 @@ class CodingEvaluator(Evaluator):
|
|
|
201
201
|
The sanitized files if pre_sanitize is True and a sanitizer exists for the language; otherwise, the original files.
|
|
202
202
|
|
|
203
203
|
examples:
|
|
204
|
-
>>> from
|
|
204
|
+
>>> from wisent.benchmarks.coding.providers.core.atoms import CodingTask
|
|
205
205
|
>>> task = CodingTask(language="python", files={}, options={"entry_point":"add","file_name":"my_solution.py"})
|
|
206
206
|
>>> files = {"my_solution.py": "def add(a,b): return a - b # BUG"}
|
|
207
207
|
>>> evaluator = CodingEvaluator(provider=None, model_fn=lambda x: {}, cfg=EvaluatorConfig(pre_sanitize=True))
|
|
@@ -234,7 +234,7 @@ class CodingEvaluator(Evaluator):
|
|
|
234
234
|
SampleOutcome for each task, indicating pass/fail status and elapsed time.
|
|
235
235
|
|
|
236
236
|
examples:
|
|
237
|
-
>>> from
|
|
237
|
+
>>> from wisent.benchmarks.coding.providers.core.atoms import CodingTask, Provider
|
|
238
238
|
>>> class DummyProvider:
|
|
239
239
|
... name = "dummy"
|
|
240
240
|
... def iter_tasks(self):
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
import re
|
|
3
3
|
from typing import List
|
|
4
|
-
from
|
|
5
|
-
from
|
|
4
|
+
from wisent.benchmarks.coding.output_sanitizer.core.atoms import TaskSchema, NormalizeResult, CodeStandardizer
|
|
5
|
+
from wisent.benchmarks.coding.output_sanitizer.utils import extract_code_block, normalize_whitespace
|
|
6
6
|
|
|
7
7
|
FUNC_RE = re.compile(r"^\s*(?:template<[^>]+>\s*)?(?:[\w:\s*&<>,]+)\s+(\w+)\s*\(", re.MULTILINE)
|
|
8
8
|
CLASS_RE = re.compile(r"^\s*class\s+(\w+)\s*[{:]", re.MULTILINE)
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
import re
|
|
4
4
|
from typing import List
|
|
5
|
-
from
|
|
6
|
-
from
|
|
5
|
+
from wisent.benchmarks.coding.output_sanitizer.core.atoms import TaskSchema, NormalizeResult, CodeStandardizer
|
|
6
|
+
from wisent.benchmarks.coding.output_sanitizer.utils import extract_code_block, normalize_whitespace
|
|
7
7
|
|
|
8
8
|
CLASS_RE = re.compile(r"\bclass\s+([A-Za-z_]\w*)")
|
|
9
9
|
METHOD_RE = re.compile(r"(public\s+static\s+[\w\<\>\[\]]+\s+)(\w+)\s*\(")
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
import ast, re
|
|
4
4
|
from typing import List
|
|
5
|
-
from
|
|
6
|
-
from
|
|
5
|
+
from wisent.benchmarks.coding.output_sanitizer.core.atoms import TaskSchema, NormalizeResult, CodeStandardizer
|
|
6
|
+
from wisent.benchmarks.coding.output_sanitizer.utils import extract_code_block, normalize_whitespace, maybe_black
|
|
7
7
|
|
|
8
8
|
class PythonStandardizer(CodeStandardizer):
|
|
9
9
|
language = "python"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
import json, os, subprocess, tempfile
|
|
3
3
|
from typing import TYPE_CHECKING
|
|
4
|
-
from
|
|
4
|
+
from wisent.benchmarks.coding.safe_docker.core.atoms import Result, SandboxExecutor
|
|
5
5
|
|
|
6
6
|
if TYPE_CHECKING:
|
|
7
|
-
from
|
|
7
|
+
from wisent.benchmarks.coding.safe_docker.core.atoms import Job
|
|
8
8
|
|
|
9
9
|
__all__ = ["DockerSandboxExecutor"]
|
|
10
10
|
|
|
@@ -49,8 +49,8 @@ class DockerSandboxExecutor(SandboxExecutor):
|
|
|
49
49
|
A Result object with the outcome of the execution.
|
|
50
50
|
|
|
51
51
|
example (pythonm add function)
|
|
52
|
-
>>> from
|
|
53
|
-
>>> from
|
|
52
|
+
>>> from wisent.benchmarks.coding.safe_docker.core.atoms import Job, Result
|
|
53
|
+
>>> from wisent.benchmarks.coding.safe_docker.core.runtime import DockerSandboxExecutor
|
|
54
54
|
>>> job = Job(
|
|
55
55
|
... language="python",
|
|
56
56
|
... compile_argv=None,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
import json, os, shutil, subprocess, sys, time, signal, resource
|
|
3
3
|
|
|
4
|
-
from
|
|
4
|
+
from wisent.benchmarks.coding.safe_docker.core.atoms import Job
|
|
5
5
|
|
|
6
6
|
JOB_FILE = "/job/job.json"
|
|
7
7
|
WORKDIR = "/work"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
from typing import Dict
|
|
3
|
-
from
|
|
3
|
+
from wisent.benchmarks.coding.safe_docker.core.atoms import Job, LanguageRecipe
|
|
4
4
|
|
|
5
5
|
class PythonRecipe(LanguageRecipe):
|
|
6
6
|
"""
|
|
@@ -7,7 +7,7 @@ import pkgutil
|
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
from typing import Any
|
|
9
9
|
|
|
10
|
-
from
|
|
10
|
+
from wisent.core.classifiers.core.atoms import BaseClassifier, ClassifierError, ClassifierTrainReport
|
|
11
11
|
|
|
12
12
|
__all__ = ["ClassifierRotator"]
|
|
13
13
|
|
|
@@ -7,7 +7,7 @@ import pkgutil
|
|
|
7
7
|
from pathlib import Path
|
|
8
8
|
from typing import Any, Dict, List, Optional, Type, Union
|
|
9
9
|
|
|
10
|
-
from
|
|
10
|
+
from wisent.core.data_loaders.core.atoms import BaseDataLoader, DataLoaderError, LoadDataResult
|
|
11
11
|
|
|
12
12
|
class DataLoaderRotator:
|
|
13
13
|
"""Discover/select a data loader and use it to load data."""
|
|
@@ -8,7 +8,7 @@ from typing import Any, Dict, List, Optional, Sequence, Union, Type
|
|
|
8
8
|
import inspect
|
|
9
9
|
import logging
|
|
10
10
|
|
|
11
|
-
from
|
|
11
|
+
from wisent.core.evaluators.core.atoms import BaseEvaluator, EvalResult, EvaluatorError
|
|
12
12
|
|
|
13
13
|
logger = logging.getLogger(__name__)
|
|
14
14
|
|
|
@@ -8,10 +8,10 @@ import pkgutil
|
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
from typing import Any, Type
|
|
10
10
|
|
|
11
|
-
from
|
|
12
|
-
from
|
|
11
|
+
from wisent.core.steering_methods.core.atoms import BaseSteeringError, BaseSteeringMethod
|
|
12
|
+
from wisent.core.contrastive_pairs.core.set import ContrastivePairSet
|
|
13
13
|
|
|
14
|
-
from
|
|
14
|
+
from wisent.core.activations.core.atoms import LayerActivations
|
|
15
15
|
|
|
16
16
|
__all__ = [
|
|
17
17
|
"SteeringMethodRotator",
|
|
@@ -9,7 +9,7 @@ app = typer.Typer(help="Human-friendly help router")
|
|
|
9
9
|
|
|
10
10
|
def _run_cli_line(line: str) -> None:
|
|
11
11
|
from typer.main import get_command
|
|
12
|
-
from
|
|
12
|
+
from wisent.cli.wisent_cli.main import app as root_app
|
|
13
13
|
click_cmd = get_command(root_app)
|
|
14
14
|
args = shlex.split(line)
|
|
15
15
|
try:
|
|
@@ -4,8 +4,8 @@ from typing import Optional
|
|
|
4
4
|
|
|
5
5
|
import typer
|
|
6
6
|
|
|
7
|
-
from
|
|
8
|
-
from
|
|
7
|
+
from wisent.cli.wisent_cli.ui import echo
|
|
8
|
+
from wisent.cli.wisent_cli.util import aggregations as aggs
|
|
9
9
|
|
|
10
10
|
try:
|
|
11
11
|
from rich.table import Table
|
|
@@ -33,7 +33,7 @@ def list_aggregations():
|
|
|
33
33
|
|
|
34
34
|
@app.command("list-methods")
|
|
35
35
|
def list_methods():
|
|
36
|
-
from
|
|
36
|
+
from wisent.cli.steering_methods.steering_rotator import SteeringMethodRotator # type: ignore
|
|
37
37
|
rot = SteeringMethodRotator()
|
|
38
38
|
methods = rot.list_methods()
|
|
39
39
|
if not methods:
|
|
@@ -57,7 +57,7 @@ def list_loaders(
|
|
|
57
57
|
loaders_location: Optional[str] = typer.Option(None, help="Package path or directory containing data loader modules"),
|
|
58
58
|
scope_prefix: Optional[str] = typer.Option(None, help="Limit list to module path prefix"),
|
|
59
59
|
):
|
|
60
|
-
from
|
|
60
|
+
from wisent.cli.data_loaders.data_loader_rotator import DataLoaderRotator # type: ignore
|
|
61
61
|
if loaders_location:
|
|
62
62
|
DataLoaderRotator.discover_loaders(loaders_location)
|
|
63
63
|
loaders = DataLoaderRotator.list_loaders(scope_prefix=scope_prefix)
|
|
@@ -84,8 +84,8 @@ def explain(
|
|
|
84
84
|
loaders_location: Optional[str] = typer.Option(None, help="Where to discover data loaders"),
|
|
85
85
|
aggregation: Optional[str] = typer.Option(None, help="Aggregation to describe"),
|
|
86
86
|
):
|
|
87
|
-
from
|
|
88
|
-
from
|
|
87
|
+
from wisent.cli.data_loaders.data_loader_rotator import DataLoaderRotator # type: ignore
|
|
88
|
+
from wisent.cli.steering_methods.steering_rotator import SteeringMethodRotator # type: ignore
|
|
89
89
|
|
|
90
90
|
if loaders_location:
|
|
91
91
|
DataLoaderRotator.discover_loaders(loaders_location)
|
|
@@ -130,7 +130,7 @@ def loader_args(
|
|
|
130
130
|
Useful so users know precisely what to pass (e.g., for `custom`:
|
|
131
131
|
`path, split_ratio, seed, training_limit, testing_limit`).
|
|
132
132
|
"""
|
|
133
|
-
from
|
|
133
|
+
from wisent.cli.data_loaders.data_loader_rotator import DataLoaderRotator # type: ignore
|
|
134
134
|
if loaders_location:
|
|
135
135
|
DataLoaderRotator.discover_loaders(loaders_location)
|
|
136
136
|
rot = DataLoaderRotator(loader=name, loaders_location=loaders_location or "wisent_guard.core.data_loaders.loaders")
|
|
@@ -6,9 +6,9 @@ from typing import Dict, List, Optional
|
|
|
6
6
|
|
|
7
7
|
import typer
|
|
8
8
|
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
9
|
+
from wisent.cli.wisent_cli.ui import echo
|
|
10
|
+
from wisent.cli.wisent_cli.util import aggregations as aggs
|
|
11
|
+
from wisent.cli.wisent_cli.util.parsing import (
|
|
12
12
|
parse_natural_tokens, parse_kv, parse_layers, to_bool, DTYPE_MAP,
|
|
13
13
|
)
|
|
14
14
|
|
|
@@ -25,7 +25,7 @@ __all__ = ["app", "train"]
|
|
|
25
25
|
app = typer.Typer(help="Training workflow")
|
|
26
26
|
|
|
27
27
|
def _resolve_method(method_name: Optional[str], methods_location: Optional[str]):
|
|
28
|
-
from
|
|
28
|
+
from wisent.cli.steering_methods.steering_rotator import SteeringMethodRotator # type: ignore
|
|
29
29
|
# Best effort discovery if available
|
|
30
30
|
try:
|
|
31
31
|
if methods_location and hasattr(SteeringMethodRotator, "discover_methods"):
|
|
@@ -96,11 +96,11 @@ def _show_plan(
|
|
|
96
96
|
|
|
97
97
|
code = f"""
|
|
98
98
|
# Example: Training steering vectors (auto-generated plan)
|
|
99
|
-
from
|
|
100
|
-
from
|
|
101
|
-
from
|
|
102
|
-
from
|
|
103
|
-
from
|
|
99
|
+
from wisent.core.trainers.steering_trainer import WisentSteeringTrainer
|
|
100
|
+
from wisent.core.models.wisent_model import WisentModel
|
|
101
|
+
from wisent.cli.data_loaders.data_loader_rotator import DataLoaderRotator
|
|
102
|
+
from wisent.cli.steering_methods.steering_rotator import SteeringMethodRotator
|
|
103
|
+
from wisent.core.activations.core.atoms import ActivationAggregationStrategy
|
|
104
104
|
|
|
105
105
|
# 1) Model
|
|
106
106
|
model = WisentModel(model_name={model!r}, layers={{}}, device={store_device!r})
|
|
@@ -152,9 +152,9 @@ def train(ctx: typer.Context, params: List[str] = typer.Argument(None)):
|
|
|
152
152
|
See `wisent loader-args custom` to view the exact loader arguments.
|
|
153
153
|
"""
|
|
154
154
|
# Lazy imports
|
|
155
|
-
from
|
|
156
|
-
from
|
|
157
|
-
from
|
|
155
|
+
from wisent.cli.data_loaders.data_loader_rotator import DataLoaderRotator # type: ignore
|
|
156
|
+
from wisent.core.models.wisent_model import WisentModel # type: ignore
|
|
157
|
+
from wisent.core.trainers.steering_trainer import WisentSteeringTrainer # type: ignore
|
|
158
158
|
|
|
159
159
|
tokens = list(params or []) + list(ctx.args or [])
|
|
160
160
|
top, loader_kv_raw, method_kv_raw = parse_natural_tokens(tokens)
|
|
@@ -278,11 +278,11 @@ def train(ctx: typer.Context, params: List[str] = typer.Argument(None)):
|
|
|
278
278
|
|
|
279
279
|
# -- Model -----------------------------------------------------------------
|
|
280
280
|
typer.echo(f"[+] Loading model: {model}")
|
|
281
|
-
from
|
|
281
|
+
from wisent.core.models.wisent_model import WisentModel # type: ignore
|
|
282
282
|
wmodel = WisentModel(model_name=model, layers={}, device=store_device)
|
|
283
283
|
|
|
284
284
|
# -- Data loader -----------------------------------------------------------
|
|
285
|
-
from
|
|
285
|
+
from wisent.cli.data_loaders.data_loader_rotator import DataLoaderRotator # type: ignore
|
|
286
286
|
if loaders_location:
|
|
287
287
|
DataLoaderRotator.discover_loaders(loaders_location)
|
|
288
288
|
dl_rot = DataLoaderRotator(loader=loader, loaders_location=loaders_location or "wisent_guard.core.data_loaders.loaders")
|
|
@@ -297,7 +297,7 @@ def train(ctx: typer.Context, params: List[str] = typer.Argument(None)):
|
|
|
297
297
|
typer.echo(f"[+] Steering method: {name_shown}")
|
|
298
298
|
|
|
299
299
|
# -- Trainer ---------------------------------------------------------------
|
|
300
|
-
from
|
|
300
|
+
from wisent.core.trainers.steering_trainer import WisentSteeringTrainer # type: ignore
|
|
301
301
|
torch_dtype = None if dtype is None else __import__("torch").__dict__[DTYPE_MAP[dtype]]
|
|
302
302
|
trainer = WisentSteeringTrainer(
|
|
303
303
|
model=wmodel,
|
|
@@ -3,12 +3,12 @@ from typing import Optional
|
|
|
3
3
|
|
|
4
4
|
import typer
|
|
5
5
|
|
|
6
|
-
from
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
10
|
-
from
|
|
11
|
-
from
|
|
6
|
+
from wisent.cli.wisent_cli.version import APP_NAME, APP_VERSION
|
|
7
|
+
from wisent.cli.wisent_cli.ui import print_banner
|
|
8
|
+
from wisent.cli.wisent_cli.commands.listing import app as listing_app
|
|
9
|
+
from wisent.cli.wisent_cli.commands.train_cmd import app as train_app
|
|
10
|
+
from wisent.cli.wisent_cli.commands.help_cmd import app as help_router_app
|
|
11
|
+
from wisent.cli.wisent_cli.shell import app as shell_app
|
|
12
12
|
|
|
13
13
|
app = typer.Typer(
|
|
14
14
|
no_args_is_help=True,
|
|
@@ -81,7 +81,7 @@ Tip: add [b]interactive true[/] for a guided wizard.
|
|
|
81
81
|
"""
|
|
82
82
|
try:
|
|
83
83
|
from rich.panel import Panel
|
|
84
|
-
from
|
|
84
|
+
from wisent.cli.wisent_cli.ui import echo
|
|
85
85
|
echo(Panel.fit(msg, title="Instructions", border_style="green"))
|
|
86
86
|
except Exception:
|
|
87
87
|
print(msg)
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
import shlex
|
|
3
3
|
import typer
|
|
4
4
|
|
|
5
|
-
from
|
|
5
|
+
from wisent.cli.wisent_cli.ui import print_banner, echo
|
|
6
6
|
|
|
7
7
|
try:
|
|
8
8
|
from rich.panel import Panel
|
|
@@ -16,7 +16,7 @@ app = typer.Typer(help="Interactive shell")
|
|
|
16
16
|
|
|
17
17
|
def _run_cli_line(line: str) -> None:
|
|
18
18
|
from typer.main import get_command
|
|
19
|
-
from
|
|
19
|
+
from wisent.cli.wisent_cli.main import app as root_app
|
|
20
20
|
click_cmd = get_command(root_app)
|
|
21
21
|
args = shlex.split(line)
|
|
22
22
|
try:
|
|
@@ -4,7 +4,7 @@ from typing import Dict, Optional
|
|
|
4
4
|
__all__ = ["agg_cls", "descriptions", "name_map", "pick"]
|
|
5
5
|
|
|
6
6
|
def agg_cls():
|
|
7
|
-
from
|
|
7
|
+
from wisent.core.activations.core.atoms import ActivationAggregationStrategy
|
|
8
8
|
return ActivationAggregationStrategy
|
|
9
9
|
|
|
10
10
|
def descriptions() -> Dict[object, str]:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
from
|
|
2
|
-
from
|
|
1
|
+
from wisent.core.activations import Activations
|
|
2
|
+
from wisent.core.classifier.classifier import ActivationClassifier, Classifier
|
|
3
3
|
|
|
4
4
|
from .utils.device import empty_device_cache, preferred_dtype, resolve_default_device, resolve_device, resolve_torch_device
|
|
5
5
|
from .steering import SteeringMethod, SteeringType
|
|
@@ -4,9 +4,9 @@ from typing import Sequence
|
|
|
4
4
|
import torch
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
from
|
|
8
|
-
from
|
|
9
|
-
from
|
|
7
|
+
from wisent.core.contrastive_pairs.core.pair import ContrastivePair
|
|
8
|
+
from wisent.core.activations.core.atoms import LayerActivations, ActivationAggregationStrategy, LayerName, RawActivationMap
|
|
9
|
+
from wisent.core.models.wisent_model import WisentModel
|
|
10
10
|
__all__ = ["ActivationCollector"]
|
|
11
11
|
|
|
12
12
|
@dataclass(slots=True)
|
|
@@ -315,8 +315,8 @@ def _resp_text(resp_obj: object) -> str:
|
|
|
315
315
|
return str(resp_obj)
|
|
316
316
|
|
|
317
317
|
if __name__ == "__main__":
|
|
318
|
-
from
|
|
319
|
-
from
|
|
318
|
+
from wisent.core.contrastive_pairs.core.pair import ContrastivePair
|
|
319
|
+
from wisent.core.contrastive_pairs.core.response import PositiveResponse, NegativeResponse
|
|
320
320
|
|
|
321
321
|
model = WisentModel(model_name="/home/gg/.cache/huggingface/hub/models--meta-llama--Llama-3.2-1B-Instruct/snapshots/9213176726f574b556790deb65791e0c5aa438b6")
|
|
322
322
|
collector = ActivationCollector(model=model, store_device="cpu")
|
|
@@ -19,7 +19,7 @@ import hashlib
|
|
|
19
19
|
|
|
20
20
|
import torch
|
|
21
21
|
|
|
22
|
-
from
|
|
22
|
+
from wisent.core.utils.device import resolve_default_device
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
@dataclass
|
|
@@ -145,7 +145,7 @@ sys.path.append('.')
|
|
|
145
145
|
|
|
146
146
|
start_time = time.time()
|
|
147
147
|
try:
|
|
148
|
-
from
|
|
148
|
+
from wisent.core.model import Model
|
|
149
149
|
# Use the actual model that will be used in production
|
|
150
150
|
model = Model("meta-llama/Llama-3.1-8B-Instruct")
|
|
151
151
|
end_time = time.time()
|
|
@@ -194,7 +194,7 @@ print("BENCHMARK_DEBUG: Starting evaluation benchmark")
|
|
|
194
194
|
start_time = time.time()
|
|
195
195
|
try:
|
|
196
196
|
print("BENCHMARK_DEBUG: Importing CLI...")
|
|
197
|
-
from
|
|
197
|
+
from wisent.cli import run_task_pipeline
|
|
198
198
|
print("BENCHMARK_DEBUG: CLI imported successfully")
|
|
199
199
|
|
|
200
200
|
print("BENCHMARK_DEBUG: Running task pipeline...")
|
|
@@ -286,9 +286,9 @@ from pathlib import Path
|
|
|
286
286
|
from typing import Dict, Optional
|
|
287
287
|
try:
|
|
288
288
|
print("BENCHMARK_DEBUG: Importing required modules...")
|
|
289
|
-
from
|
|
290
|
-
from
|
|
291
|
-
from
|
|
289
|
+
from wisent.core.model import Model
|
|
290
|
+
from wisent.core.agent.diagnose.synthetic_classifier_option import create_classifier_from_trait_description
|
|
291
|
+
from wisent.core.agent.budget import set_time_budget
|
|
292
292
|
import time
|
|
293
293
|
print("BENCHMARK_DEBUG: All modules imported successfully")
|
|
294
294
|
|
|
@@ -389,7 +389,7 @@ sys.path.append('.')
|
|
|
389
389
|
|
|
390
390
|
start_time = time.time()
|
|
391
391
|
try:
|
|
392
|
-
from
|
|
392
|
+
from wisent.cli import run_task_pipeline
|
|
393
393
|
|
|
394
394
|
# Run actual steering with real model and minimal examples
|
|
395
395
|
run_task_pipeline(
|
|
@@ -454,8 +454,8 @@ sys.path.append('.')
|
|
|
454
454
|
|
|
455
455
|
start_time = time.time()
|
|
456
456
|
try:
|
|
457
|
-
from
|
|
458
|
-
from
|
|
457
|
+
from wisent.core.model import Model
|
|
458
|
+
from wisent.core.contrastive_pairs.generate_synthetically import SyntheticContrastivePairGenerator
|
|
459
459
|
|
|
460
460
|
# Load the actual model
|
|
461
461
|
model = Model("meta-llama/Llama-3.1-8B-Instruct")
|
|
@@ -12,7 +12,7 @@ import time
|
|
|
12
12
|
from dataclasses import dataclass
|
|
13
13
|
from typing import Any, Dict, List, Optional, Tuple
|
|
14
14
|
|
|
15
|
-
from
|
|
15
|
+
from wisent.core.classifier.classifier import ActivationClassifier, Classifier
|
|
16
16
|
|
|
17
17
|
from ...activations import Activations
|
|
18
18
|
from ...layer import Layer
|
|
@@ -11,8 +11,8 @@ This module handles:
|
|
|
11
11
|
from dataclasses import dataclass
|
|
12
12
|
from typing import Any, Dict, List
|
|
13
13
|
|
|
14
|
-
from
|
|
15
|
-
from
|
|
14
|
+
from wisent.core.activations import ActivationAggregationStrategy, Activations
|
|
15
|
+
from wisent.core.classifier.classifier import Classifier
|
|
16
16
|
|
|
17
17
|
from ...layer import Layer
|
|
18
18
|
from ...model import Model
|
|
@@ -11,7 +11,7 @@ import time
|
|
|
11
11
|
from dataclasses import dataclass
|
|
12
12
|
from typing import List, Tuple
|
|
13
13
|
|
|
14
|
-
from
|
|
14
|
+
from wisent.core.classifier.classifier import ActivationClassifier
|
|
15
15
|
|
|
16
16
|
from ....core.agent.budget import ResourceType, calculate_max_tasks_for_time_budget, get_budget_manager
|
|
17
17
|
from ....core.contrastive_pairs.generate_synthetically import SyntheticContrastivePairGenerator
|
|
@@ -136,7 +136,7 @@ class SyntheticClassifierFactory:
|
|
|
136
136
|
logging.info(f"Extracting activations from {len(pair_set.pairs)} pairs...")
|
|
137
137
|
|
|
138
138
|
# Create Layer object for activation extraction
|
|
139
|
-
from
|
|
139
|
+
from wisent.core.layer import Layer
|
|
140
140
|
|
|
141
141
|
layer_obj = Layer(index=15, type="transformer")
|
|
142
142
|
logging.info(f"Created Layer object: index={layer_obj.index}, type={layer_obj.type}")
|
|
@@ -193,13 +193,13 @@ class SyntheticClassifierFactory:
|
|
|
193
193
|
logging.info("Starting classifier training...")
|
|
194
194
|
try:
|
|
195
195
|
# Convert activations to the format expected by train_on_activations method
|
|
196
|
-
from
|
|
196
|
+
from wisent.core.activations import Activations
|
|
197
197
|
|
|
198
198
|
# Convert torch tensors to Activations objects if needed
|
|
199
199
|
harmful_activations = []
|
|
200
200
|
harmless_activations = []
|
|
201
201
|
|
|
202
|
-
from
|
|
202
|
+
from wisent.core.layer import Layer
|
|
203
203
|
|
|
204
204
|
layer_obj = Layer(index=15, type="transformer")
|
|
205
205
|
|
|
@@ -598,7 +598,7 @@ def create_classifier_from_trait_description(
|
|
|
598
598
|
log_and_print(f"🧠 Extracting activations from {len(pair_set.pairs)} pairs...")
|
|
599
599
|
|
|
600
600
|
# Create Layer object for activation extraction
|
|
601
|
-
from
|
|
601
|
+
from wisent.core.layer import Layer
|
|
602
602
|
|
|
603
603
|
layer_obj = Layer(index=15, type="transformer")
|
|
604
604
|
log_and_print(f"🔧 Created Layer object: index={layer_obj.index}, type={layer_obj.type}")
|
|
@@ -655,7 +655,7 @@ def create_classifier_from_trait_description(
|
|
|
655
655
|
log_and_print("🎯 Starting classifier training...")
|
|
656
656
|
try:
|
|
657
657
|
# Convert activations to the format expected by train_on_activations method
|
|
658
|
-
from
|
|
658
|
+
from wisent.core.activations import Activations
|
|
659
659
|
|
|
660
660
|
# Convert torch tensors to Activations objects if needed
|
|
661
661
|
harmful_activations = []
|
|
@@ -7,12 +7,12 @@ from pathlib import Path
|
|
|
7
7
|
project_root = Path(__file__).parent.parent.parent.parent
|
|
8
8
|
sys.path.insert(0, str(project_root))
|
|
9
9
|
|
|
10
|
-
from
|
|
11
|
-
from
|
|
10
|
+
from wisent.core.model import Model
|
|
11
|
+
from wisent.core.agent.diagnose.synthetic_classifier_option import (
|
|
12
12
|
create_classifiers_for_prompt,
|
|
13
13
|
apply_classifiers_to_response
|
|
14
14
|
)
|
|
15
|
-
from
|
|
15
|
+
from wisent.core.agent.budget import set_time_budget
|
|
16
16
|
|
|
17
17
|
class TimeoutError(Exception):
|
|
18
18
|
"""Raised when test exceeds time budget."""
|
|
@@ -11,8 +11,8 @@ This module handles:
|
|
|
11
11
|
from dataclasses import dataclass
|
|
12
12
|
from typing import Any, Dict, List
|
|
13
13
|
|
|
14
|
-
from
|
|
15
|
-
from
|
|
14
|
+
from wisent.core.activations import ActivationAggregationStrategy, Activations
|
|
15
|
+
from wisent.core.classifier.classifier import Classifier
|
|
16
16
|
|
|
17
17
|
from ..layer import Layer
|
|
18
18
|
from ..model import Model
|