Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update run_trainier_seq2seq_huggingface.py #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/run_trainier_seq2seq_huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

import nltk # Here to have a nice missing dependency error message early on
import numpy as np
from datasets import load_dataset, load_metric
from datasets import load_dataset
import evaluate
from sklearn.metrics import accuracy_score, f1_score, recall_score, precision_score, classification_report, confusion_matrix

import transformers
Expand Down Expand Up @@ -562,7 +563,7 @@ def preprocess_function(examples):
metric_name = regex.sub("eval_","",training_args.metric_for_best_model)
# metric_name = "f1" #"rouge" if data_args.task.startswith("summarization") else "sacrebleu"
print ("[INFO] evlaute using ", metric_name, "score", "task name:", data_args.task)
# metric = load_metric("f1", cache_dir=cache_dir)
# metric = evaluate.Metric("f1", cache_dir=cache_dir)

def postprocess_text(preds, labels):
preds = [pred.strip() for pred in preds]
Expand Down