Skip to content

Commit

Permalink
Fix issues in example scripts: (#454)
Browse files Browse the repository at this point in the history
- GLUE script with STS-B
- UDP script evaluation
  • Loading branch information
calpt authored Nov 28, 2022
1 parent d713de3 commit 3baaa1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/pytorch/dependency-parsing/utils_udp.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def __init__(
def evaluate(
self,
eval_dataset: Optional[Dataset] = None,
prediction_loss_only: Optional[bool] = None,
ignore_keys: Optional[List[str]] = None,
metric_key_prefix: str = "eval",
) -> Dict[str, float]:
"""
Expand All @@ -232,7 +232,7 @@ def evaluate(
output = self._prediction_loop(
eval_dataloader,
description="Evaluation",
prediction_loss_only=prediction_loss_only,
prediction_loss_only=True if self.compute_metrics is None else None,
metric_key_prefix=metric_key_prefix,
)

Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch/text-classification/run_glue.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ def main():
model.add_classification_head(
data_args.task_name or "glue",
num_labels=num_labels,
id2label={i: v for i, v in enumerate(label_list)} if num_labels > 0 else None,
id2label={i: v for i, v in enumerate(label_list)} if not is_regression else None,
)

# Setup adapters
Expand Down

0 comments on commit 3baaa1e

Please sign in to comment.