-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
[examples] unit test for run_bart_sum #3544
[examples] unit test for run_bart_sum #3544
Conversation
…formers_fork into testability-run-bart-sum
@@ -102,8 +102,8 @@ def optimizer_step(self, epoch, batch_idx, optimizer, optimizer_idx, second_orde | |||
self.lr_scheduler.step() | |||
|
|||
def get_tqdm_dict(self): | |||
tqdm_dict = {"loss": "{:.3f}".format(self.trainer.avg_loss), "lr": self.lr_scheduler.get_last_lr()[-1]} | |||
|
|||
avg_loss = getattr(self.trainer, "avg_loss", 0.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.trainer.avg_loss
was raising AttributeError
Codecov Report
@@ Coverage Diff @@
## master #3544 +/- ##
==========================================
+ Coverage 76.84% 77.81% +0.97%
==========================================
Files 100 100
Lines 17064 17064
==========================================
+ Hits 13112 13279 +167
+ Misses 3952 3785 -167
Continue to review full report at Codecov.
|
from utils import SummarizationDataset | ||
|
||
|
||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to support being called from from pwd or examples/
@@ -0,0 +1,33 @@ | |||
# Script for verifying that run_bart_sum can be invoked from its directory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Runs same logic as run_train.sh
on a tiny dataset
LGTM from a superficial glance |
try: | ||
from .utils import SummarizationDataset | ||
except ImportError: | ||
from utils import SummarizationDataset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked @aaugustin if there's an easy way to not resort to this kind of hack
Planning on merging this April 15 at 7pm EST barring objections. |
examples/requirements.txt