kaikaidai commited on
Commit
a0538fa
·
verified ·
1 Parent(s): c0ee84f

Add safety checks

Browse files
Files changed (1) hide show
  1. app.py +10 -9
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
- # Parse the responses based on model, using appropriate parsing for different models
742
- is_prometheus_a = (model_data.get(model_a)['organization'] == 'Prometheus')
743
- is_prometheus_b = (model_data.get(model_b)['organization'] == 'Prometheus')
744
- is_atla_a = (model_data.get(model_a)['organization'] == 'Atla')
745
- is_atla_b = (model_data.get(model_b)['organization'] == 'Atla')
746
- is_flow_judge_a = (model_data.get(model_a)['organization'] == 'Flow AI')
747
- is_flow_judge_b = (model_data.get(model_b)['organization'] == 'Flow AI')
748
- is_salesforce_a = (model_data.get(model_a)['organization'] == 'Salesforce')
749
- is_salesforce_b = (model_data.get(model_b)['organization'] == 'Salesforce')
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"