jedick commited on
Commit
b16a131
·
1 Parent(s): ba11bb4

Fix duplicated argument in _run_judge() call

Browse files
Files changed (3) hide show
  1. app.py +1 -1
  2. app_functions.py +10 -15
  3. requirements.txt +1 -0
app.py CHANGED
@@ -74,7 +74,7 @@ def run_judge(
74
  old_revision,
75
  new_revision,
76
  heuristic_noteworthy,
77
- heuristic_noteworthy,
78
  heuristic_rationale,
79
  fewshot_rationale,
80
  )
 
74
  old_revision,
75
  new_revision,
76
  heuristic_noteworthy,
77
+ fewshot_noteworthy,
78
  heuristic_rationale,
79
  fewshot_rationale,
80
  )
app_functions.py CHANGED
@@ -172,16 +172,10 @@ def compute_confidence(
172
  heuristic_noteworthy,
173
  fewshot_noteworthy,
174
  judge_noteworthy,
175
- heuristic_rationale,
176
- fewshot_rationale,
177
- judge_reasoning,
178
  ):
179
  """
180
  Compute a confidence label using the noteworthy booleans.
181
  """
182
- # Return None if any of the rationales or reasoning is missing.
183
- if not heuristic_rationale or not fewshot_rationale or not judge_reasoning:
184
- return None
185
  if heuristic_noteworthy == fewshot_noteworthy == judge_noteworthy:
186
  # Classifiers and judge all agree
187
  return "High"
@@ -253,14 +247,15 @@ def _run_judge(
253
  else:
254
  noteworthy_text = str(noteworthy)
255
 
256
- # Get confidence score
257
- confidence = compute_confidence(
258
- heuristic_noteworthy,
259
- fewshot_noteworthy,
260
- noteworthy,
261
- heuristic_rationale,
262
- fewshot_rationale,
263
- reasoning,
264
- )
 
265
 
266
  return noteworthy, noteworthy_text, reasoning, confidence
 
172
  heuristic_noteworthy,
173
  fewshot_noteworthy,
174
  judge_noteworthy,
 
 
 
175
  ):
176
  """
177
  Compute a confidence label using the noteworthy booleans.
178
  """
 
 
 
179
  if heuristic_noteworthy == fewshot_noteworthy == judge_noteworthy:
180
  # Classifiers and judge all agree
181
  return "High"
 
247
  else:
248
  noteworthy_text = str(noteworthy)
249
 
250
+ # Return no confidence score if any of the rationales or reasoning is missing
251
+ if not heuristic_rationale or not fewshot_rationale or not reasoning:
252
+ confidence = None
253
+ else:
254
+ # Get confidence score
255
+ confidence = compute_confidence(
256
+ heuristic_noteworthy,
257
+ fewshot_noteworthy,
258
+ noteworthy,
259
+ )
260
 
261
  return noteworthy, noteworthy_text, reasoning, confidence
requirements.txt CHANGED
@@ -6,3 +6,4 @@ gradio>=6.0.1
6
  requests
7
  logfire
8
  opentelemetry-instrumentation-google-genai
 
 
6
  requests
7
  logfire
8
  opentelemetry-instrumentation-google-genai
9
+ huggingface-hub