-
Notifications
You must be signed in to change notification settings - Fork 63
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
Huggingface Trainer closes run automatically after training #1663
Comments
Hey @Ulipenitz 👋 Please let me know if any of these work for you 🤗 |
Thanks for the answer @SiddhantSadangi! |
Ah, understood! I think your workaround does handle this pretty well in the absence of official support for this use case. I'll just suggest using trainer = Trainer(
...
callbacks=[neptune_callback],
)
logger.info("This will be logged to Neptune")
trainer.train()
logger.info("This won't be logged to Neptune")
run = neptune_callback.get_run(trainer)
neptune_handler = NeptuneHandler(run=run)
logger.addHandler(neptune_handler)
logger.info("This will be logged to Neptune") Please let me know if this workaround works better for you 🙏 I will also pass this feedback to the product team ✅ |
Is your feature request related to a problem? Please describe.
When I use a Huggingface Trainer with a NeptuneCallback, it seems that the Trainer closes the run automatically & thus disconnects it from the python logger.
If I want to log anything to Neptune after training, I have to reinitialize the run, which makes the code complex in bigger training pipelines.
Describe the solution you'd like
Would be great if the run persists.
Describe alternatives you've considered
My workaround looks like this:
main.py:
training_function.py:
The text was updated successfully, but these errors were encountered: