init
Browse files
training_scripts/finetune_t5.py
CHANGED
@@ -163,8 +163,8 @@ def validate(
|
|
163 |
data = [i[dataset_column_text] for i in dataset_instance]
|
164 |
model_score = []
|
165 |
for model_path in glob(f"{output_dir}/*/*"):
|
166 |
-
prediction_file = f"{model_path}/prediction.validate.{dataset}.{dataset_name}.txt"
|
167 |
-
metric_file = f"{model_path}/metric.validate.{dataset}.{dataset_name}.json"
|
168 |
metric = get_metric(
|
169 |
prediction_file=prediction_file,
|
170 |
metric_file=metric_file,
|
@@ -195,8 +195,8 @@ def test(
|
|
195 |
label = [i[dataset_column_label] for i in dataset_instance]
|
196 |
data = [i[dataset_column_text] for i in dataset_instance]
|
197 |
model_path = f'{output_dir}/best_model'
|
198 |
-
prediction_file = f"{model_path}/prediction.{dataset}.{dataset_name}.txt"
|
199 |
-
metric_file = f"{model_path}/metric.{dataset}.{dataset_name}.json"
|
200 |
metric = get_metric(
|
201 |
prediction_file=prediction_file,
|
202 |
metric_file=metric_file,
|
|
|
163 |
data = [i[dataset_column_text] for i in dataset_instance]
|
164 |
model_score = []
|
165 |
for model_path in glob(f"{output_dir}/*/*"):
|
166 |
+
prediction_file = f"{model_path}/prediction.validate.{os.path.basename(dataset)}.{dataset_name}.txt"
|
167 |
+
metric_file = f"{model_path}/metric.validate.{os.path.basename(dataset)}.{dataset_name}.json"
|
168 |
metric = get_metric(
|
169 |
prediction_file=prediction_file,
|
170 |
metric_file=metric_file,
|
|
|
195 |
label = [i[dataset_column_label] for i in dataset_instance]
|
196 |
data = [i[dataset_column_text] for i in dataset_instance]
|
197 |
model_path = f'{output_dir}/best_model'
|
198 |
+
prediction_file = f"{model_path}/prediction.{os.path.basename(dataset)}.{dataset_name}.txt"
|
199 |
+
metric_file = f"{model_path}/metric.{os.path.basename(dataset)}.{dataset_name}.json"
|
200 |
metric = get_metric(
|
201 |
prediction_file=prediction_file,
|
202 |
metric_file=metric_file,
|