Skip to content

Commit

Permalink
fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
chaitanyamalaviya committed Nov 9, 2024
1 parent 388927c commit b7782d0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
1 change: 0 additions & 1 deletion contexteval/main/compute_human_agreement.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import sys
sys.path.append('contexteval/common')
from scipy.stats import sem, t, ttest_ind, ttest_rel
from statsmodels.stats import inter_rater as irr


_EVAL_JUDGMENTS = flags.DEFINE_string(
Expand Down
5 changes: 0 additions & 5 deletions contexteval/main/generate_analysis_evals.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,8 @@ def get_qa(input_str):

def get_eval_judgement(cur_prompt, model):
dict_out = None
count = 0
while dict_out is None:
eval_judgement = model.generate(cur_prompt)
# dict_out = extract_dictionary(eval_judgement)
# count += 1
# if count == 3:
# break
break
return eval_judgement

Expand Down
4 changes: 1 addition & 3 deletions contexteval/main/generate_analysis_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ def extract_dictionary(input_string):
dict_str = input_string[dict_start:dict_end]
dictionary = ast.literal_eval(dict_str)
return dictionary
except Exception as e:
# print(input_string)
# print(f"Error occurred: {e}")
except Exception:
return None


Expand Down
6 changes: 3 additions & 3 deletions contexteval/main/generate_context_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ def extract_dictionary(input_string):
dict_str = input_string[dict_start:dict_end]
dictionary = ast.literal_eval(dict_str)
return dictionary
except Exception as e:
except Exception:
return None


def check_output_format(input_string):
try:
input_string = input_string.replace("*", "").strip()
Expand Down Expand Up @@ -130,7 +130,7 @@ def main(unused_argv) -> None:
tries = 0
ex = None
# Pick context generated by one of the three models
while skip==True:
while skip:
if model_idx == 1:
ex = examples[MODEL_ONE][idx]
elif model_idx == 2:
Expand Down

0 comments on commit b7782d0

Please sign in to comment.