-
Notifications
You must be signed in to change notification settings - Fork 248
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
add f_net_classifier and f_net_classifier_test #670
Conversation
@ADITYADAS1999 looks like there are some testing failures, could you take a look at those first? You'll probably want an environment in which you can reproduce the failure locally, as described in our contributing guide. |
okk I test the file locally |
when I use this commands for windows it show this errors in my pycharm editor isort --sp "setup.cfg" --sl python version 3.7 |
@ADITYADAS1999, pass the complete path from the root of the repository. Instead of So, your commands will be:
Hope this solves the issue! :) |
thanks abheesht17, I will try this commands |
@ADITYADAS1999 - it is recommended that if you are using Windows, use WSL. Makes life very easy! You can follow this guide: https://learn.microsoft.com/en-us/windows/wsl/install. |
can you conform that test commands for linux are correct or not shell/format.sh |
@ADITYADAS1999, yep! The commands are correct. Do you have the correct black and flake version though? Please follow the pip install commands given here: https://github.com/keras-team/keras-nlp/blob/master/CONTRIBUTING.md#formatting-code. |
yes I install both |
hey @mattdangerw can you review this one, If necessary changes are require , All tests are now passed. |
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.
Thank you! And nice work on this!
Overall it is looking good, only major comment is we need to add some more "presets" testing. Commented below. Thanks!
|
||
@keras.utils.register_keras_serializable(package="keras_nlp") | ||
class FNetClassifier(Task): | ||
|
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.
no newline before docstring
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Tests for FNET classification model.""" |
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.
FNET -> FNet (even the paper authors do not style this all caps)
from keras_nlp.models.f_net.f_net_tokenizer import FNetTokenizer | ||
|
||
|
||
class FNetClassifierTest(tf.test.TestCase, parameterized.TestCase): |
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.
You will also need to add some preset tests in f_net_presets_tests.py
, you can take a look at #668, which is doing a similar thing for AlBERT.
Thats awesome, made the changes soon |
hey @mattdangerw I made necessary changes |
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.
@ADITYADAS1999 LGTM.
There are a few test failures currently for the preset tests. Running these are a bit funky... you can specify --run_extra_large
flag when running these test, but it will download a lot of data so will be slow (hence the flag)! It helps to only run these tests for a single application at a time.
E.g. you could catch the current error by running
pytest keras_nlp/models/f_net --run_extra_large
But anyway, the issues here our minor, I can just fix these up as I land. Thanks for the contribution!
So this command basically tests large files in locally , 👀 I use this for future contribution thanks. Thanks 👍 @mattdangerw @abheesht17 for fixing and merging the PR 🎉 |
Add FNetClassifier #650
Here I add two script at f_net folder.
But we need to improve the f_net_classifier file, because if this model similar to BertClassifier, then the f_net_presets.py file is require that is not present at f_net folder.
@abheesht17 @mattdangerw