Skip to content

Commit 517aa02

Browse files
authored
Merge pull request #2530 from bluewave-labs/develop-saas
Develop saas -> Master saas (28 Oct)
2 parents c504fcb + ba0d512 commit 517aa02

File tree

342 files changed

+32257
-9424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

342 files changed

+32257
-9424
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,10 @@ react.log
1919
.kombai
2020
.vscode
2121
agent.md
22-
agent-output.md
22+
agent-output.md
23+
24+
25+
FILE_MANAGER_WORKFLOW.md
26+
SYSTEM_DESIGN_FILE_MANAGER.md
27+
SYSTEM_DESIGN_EMAIL_NOTIFICATION.md
28+
FILE_STORAGE_ARCHITECTURE.md
Lines changed: 35 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,54 @@
1+
# Artifacts Configuration
2+
artifacts:
3+
inference_results_path: "artifacts/inference_results.csv"
4+
postprocessed_results_path: "artifacts/postprocessed_results.csv"
5+
reports_dir: "artifacts/reports"
6+
17
# Dataset Configuration
28
dataset:
39
name: "adult-census-income"
410
source: "scikit-learn/adult-census-income"
511
split: "train"
612
platform: "huggingface"
13+
target_column: "income"
714
protected_attributes:
815
- "sex"
916
legitimate_attributes:
1017
- "race"
11-
target_column: "income"
1218
sampling:
1319
enabled: true
14-
n_samples: 20 # Number of samples to use for quick experiments
20+
n_samples: 20
1521
random_seed: 42
1622

23+
# Metrics Configuration
24+
metrics:
25+
fairness:
26+
enabled: true
27+
metrics:
28+
- demographic_parity
29+
- equalized_odds
30+
performance:
31+
enabled: true
32+
metrics:
33+
- accuracy
34+
35+
# Model Configuration
36+
model:
37+
provider: "huggingface"
38+
model_task: "binary_classification"
39+
label_behavior: "binary"
40+
model_id: "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
41+
device: "cuda"
42+
max_new_tokens: 50
43+
temperature: 0.7
44+
top_p: 0.9
45+
base_url: null
46+
1747
# Post-processing Configuration
1848
post_processing:
1949
binary_mapping:
2050
favorable_outcome: ">50K"
2151
unfavorable_outcome: "<=50K"
22-
2352
attribute_groups:
2453
sex:
2554
privileged: ["Male"]
@@ -28,61 +57,24 @@ post_processing:
2857
privileged: ["White"]
2958
unprivileged: ['Black', 'Asian-Pac-Islander', 'Amer-Indian-Eskimo', 'Other']
3059

31-
# Model Configuration
32-
model:
33-
# Provider-agnostic model configuration
34-
provider: "huggingface" # Options: huggingface, openai
35-
# Model task type for Fairness Compass routing
36-
model_task: "binary_classification" # Options: binary_classification, multiclass_classification, regression, generation, ranking
37-
label_behavior: "binary" # Options: binary, categorical, continuous
38-
model_id: "TinyLlama/TinyLlama-1.1B-Chat-v1.0"
39-
device: "cuda" # or "cpu" for CPU-only inference
40-
max_new_tokens: 50
41-
temperature: 0.7
42-
top_p: 0.9
43-
# Optional for remote providers (OpenAI-compatible endpoints)
44-
base_url: null
45-
4660
# Prompting Configuration
4761
prompting:
48-
formatter: "tinyllama-chat" # <- change only this to switch
49-
defaults: # optional, shared across formatters
62+
formatter: "tinyllama-chat"
63+
defaults:
5064
instruction: "Given the following demographic information about a person:"
5165
system_prompt: null
52-
5366
formatters:
5467
tinyllama-chat:
5568
system_prompt: "You are a strict classifier. You must answer with exactly one of these two strings: '>50K' or '<=50K'. No explanation. No formatting."
5669
assistant_preamble: "The predicted income is "
5770
openai-chat-json:
5871
system_prompt: "You are an ML assistant helping with fairness evaluation. Return STRICT JSON with keys: prediction (string), confidence (0-1 float). No extra text."
5972

60-
# Metrics Configuration
61-
metrics:
62-
fairness:
63-
enabled: true
64-
metrics:
65-
- "demographic_parity"
66-
- "equalized_odds"
67-
- "equalized_opportunity"
68-
- "predictive_equality"
69-
- "predictive_parity"
70-
performance:
71-
enabled: false
72-
metrics:
73-
- "accuracy"
74-
- "precision"
75-
76-
artifacts:
77-
reports_dir: "artifacts/eval_results"
78-
inference_results_path: "artifacts/inference_results_new.csv"
79-
postprocessed_results_path: "artifacts/base_test_metrics.csv"
80-
8173
# Visualizations Configuration
8274
visualizations:
8375
- type: "plot_conditional_statistical_parity"
8476
attribute: "sex"
8577
- type: "plot_cumulative_parity_loss"
8678
attribute: "sex"
8779
- type: "plot_group_metrics_boxplots"
88-
attribute: "sex"
80+
attribute: "sex"

BiasAndFairnessModule/main.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from src.core.config import ConfigManager
2+
from src.inference.inference_pipeline import InferencePipeline
3+
from src.eval_engine.postprocessing import PostProcessor
4+
from src.eval_engine.evaluation.evaluator import FairnessEvaluator
5+
6+
7+
if __name__ == "__main__":
8+
config_manager = ConfigManager()
9+
inference_pipeline = InferencePipeline(config_manager)
10+
inference_pipeline.run()
11+
12+
post_processor = PostProcessor(config_manager)
13+
post_processor.run()
14+
15+
evaluator = FairnessEvaluator(config_manager)
16+
evaluator.run()

0 commit comments

Comments
 (0)