Spaces:
Running
Running
Add safety checks
Browse files
app.py
CHANGED
|
@@ -738,16 +738,17 @@ with gr.Blocks(theme="default", css=CSS_STYLES) as demo:
|
|
| 738 |
use_reference=use_reference
|
| 739 |
)
|
| 740 |
|
| 741 |
-
|
| 742 |
-
is_prometheus_a =
|
| 743 |
-
is_prometheus_b =
|
| 744 |
-
is_atla_a =
|
| 745 |
-
is_atla_b =
|
| 746 |
-
is_flow_judge_a =
|
| 747 |
-
is_flow_judge_b =
|
| 748 |
-
is_salesforce_a =
|
| 749 |
-
is_salesforce_b =
|
| 750 |
|
|
|
|
| 751 |
if is_prometheus_a:
|
| 752 |
score_a_val, critique_a_val = prometheus_parse_model_response(response_a)
|
| 753 |
score_a_val = f"{score_a_val} / 5"
|
|
|
|
| 738 |
use_reference=use_reference
|
| 739 |
)
|
| 740 |
|
| 741 |
+
|
| 742 |
+
is_prometheus_a = model_data.get(model_a, {}).get('organization') == 'Prometheus'
|
| 743 |
+
is_prometheus_b = model_data.get(model_b, {}).get('organization') == 'Prometheus'
|
| 744 |
+
is_atla_a = model_data.get(model_a, {}).get('organization') == 'Atla'
|
| 745 |
+
is_atla_b = model_data.get(model_b, {}).get('organization') == 'Atla'
|
| 746 |
+
is_flow_judge_a = model_data.get(model_a, {}).get('organization') == 'Flow AI'
|
| 747 |
+
is_flow_judge_b = model_data.get(model_b, {}).get('organization') == 'Flow AI'
|
| 748 |
+
is_salesforce_a = model_data.get(model_a, {}).get('organization') == 'Salesforce'
|
| 749 |
+
is_salesforce_b = model_data.get(model_b, {}).get('organization') == 'Salesforce'
|
| 750 |
|
| 751 |
+
# Parse the responses based on model, using appropriate parsing for different models
|
| 752 |
if is_prometheus_a:
|
| 753 |
score_a_val, critique_a_val = prometheus_parse_model_response(response_a)
|
| 754 |
score_a_val = f"{score_a_val} / 5"
|