Skip to content

Commit

Permalink
fix hpo exmple (#1122)
Browse files Browse the repository at this point in the history
* fix hpo exmple

Signed-off-by: Guo, Heng <[email protected]>
  • Loading branch information
n1ck-guo authored Jul 28, 2023
1 parent 6613cfa commit 291c4fa
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ def preprocess_function(examples):

eval_metric = metric.compute()
logger.info(f"mnli-mm: {eval_metric}")
return eval_metric


if __name__ == "__main__":
Expand All @@ -652,7 +653,7 @@ def preprocess_function(examples):
higher_is_better=True,
min_train_samples=3)
searcher = prepare_hpo(config)
for iter in range(10):
for iter in range(5):
print(f'search iter {iter}')
st = time.time()
params = searcher.suggest()
Expand All @@ -666,5 +667,5 @@ def preprocess_function(examples):
acc = metric['accuracy']
f1 = metric['f1']
rt = time.time() - st
tmp_str = f'{iter + 10}\t{params}\t{acc}\t{f1}\t{rt}\n'
tmp_str = f'{iter}\t{params}\t{acc}\t{f1}\t{rt}\n'
print(tmp_str)

0 comments on commit 291c4fa

Please sign in to comment.