mirror of
https://github.com/GokuMohandas/Made-With-ML.git
synced 2026-03-09 07:12:37 -05:00
Foundations --> Transformers #36
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @shashankvasisht on GitHub (Jun 14, 2022).
Hi Goku... I am really thankful for all your amazing tutorials.
I however was facing some issues in the Transformers lecture. There are a few minor bugs here with missing variables and imports; which was not an issue.
The training code however is missing the block:
Also when i wrote this and ran it, I got an error:
Apparently, the issue comes from the line :
wherein the "pool" returned is of class string.
Upon printing the type and the value of it i get the following :
Can you please have a look into this.
Thanks in Advance!!
@GokuMohandas commented on GitHub (Jun 14, 2022):
HI @shashankvasisht, based on the error messages, it looks like you're running this on a local notebook instead of running on Google colab directly? If not, make sure you have the exact version of the transformers (3.0.2) package (their future releases might be not be backwards compatible) and other packages as well (use
pip freezeinside the notebook to check). I just reran the notebook and it ran successfully to completion.@knosing commented on GitHub (Dec 8, 2022):
@shashankvasisht
Hi, I just got the same error and found the issue.
This error pops up if you are using the newer 4.0 ver of transformers.
So one solution is what @GokuMohandas recommended and the other would be to add the argument
return_dict=Falsewhen you pass inputs to your model:seq, pool = self.transformer(input_ids=ids, attention_mask=masks, return_dict=False)Rest all works fine, cheers!