From ac1078e3f689852fcf31425a3eb24808abe67f77 Mon Sep 17 00:00:00 2001 From: Matt Watson Date: Thu, 19 Sep 2024 16:32:57 -0700 Subject: [PATCH] Update links github links post rename They all work either way, because github handle redirects, but nice to update. --- CONTRIBUTING.md | 8 ++--- CONTRIBUTING_MODELS.md | 36 +++++++++---------- README.md | 14 ++++---- RELEASE_PROCESS.md | 12 +++---- SECURITY.md | 2 +- keras_hub/src/models/seq_2_seq_lm.py | 2 +- setup.py | 2 +- .../bert_tiny_uncased_en_sst2_training.ipynb | 2 +- 8 files changed, 39 insertions(+), 39 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b11e6024b7..f5f0bb7524 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,9 +20,9 @@ We follow The fastest way to contribute it to find open issues that need an assignee. We maintain two lists of github tags for contributors: - - [good first issue](https://github.com/keras-team/keras-nlp/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22): + - [good first issue](https://github.com/keras-team/keras-hub/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22): a list of small, well defined issues for newcomers to the project. - - [contributions welcome](https://github.com/keras-team/keras-nlp/issues?q=is%3Aissue+is%3Aopen+label%3A%22contributions+welcome%22): + - [contributions welcome](https://github.com/keras-team/keras-hub/issues?q=is%3Aissue+is%3Aopen+label%3A%22contributions+welcome%22): a larger list of issues that may range in complexity. If you would like propose a new symbol or feature, please first review our @@ -59,7 +59,7 @@ development environment and run the unit tests. This is covered in section Once the change is ready, open a pull request from your branch in your fork to the master branch in -[keras-team/keras-nlp](https://github.com/keras-team/keras-nlp). +[keras-team/keras-hub](https://github.com/keras-team/keras-hub). ### Step 4. Sign the Contributor License Agreement @@ -88,7 +88,7 @@ KerasHub repository and clone it locally. With the [GitHub CLI](https://github.com/cli/cli) installed, you can do this as follows: ```shell -gh repo fork keras-team/keras-nlp --clone --remote +gh repo fork keras-team/keras-hub --clone --remote cd keras-hub ``` diff --git a/CONTRIBUTING_MODELS.md b/CONTRIBUTING_MODELS.md index 4214495101..2a9556fd15 100644 --- a/CONTRIBUTING_MODELS.md +++ b/CONTRIBUTING_MODELS.md @@ -9,7 +9,7 @@ contribute a new pre-trained model to KerasHub. For illustration purposes, let's assume that you want to contribute the DistilBERT model. Before we dive in, we encourage you to go through [our getting started guide](https://keras.io/guides/keras_nlp/getting_started/) for an introduction to the library, and our -[contribution guide](https://github.com/keras-team/keras-nlp/blob/master/CONTRIBUTING.md). +[contribution guide](https://github.com/keras-team/keras-hub/blob/master/CONTRIBUTING.md). ## Checklist @@ -22,29 +22,29 @@ Keep this checklist handy! ### Step 2: PR #1 - Add XXBackbone -- [ ] An `xx/xx_backbone.py` file which has the model graph \[[Example](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/src/models/distil_bert/distil_bert_backbone.py)\]. -- [ ] An `xx/xx_backbone_test.py` file which has unit tests for the backbone \[[Example](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/src/models/distil_bert/distil_bert_backbone_test.py)\]. +- [ ] An `xx/xx_backbone.py` file which has the model graph \[[Example](https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/distil_bert/distil_bert_backbone.py)\]. +- [ ] An `xx/xx_backbone_test.py` file which has unit tests for the backbone \[[Example](https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/distil_bert/distil_bert_backbone_test.py)\]. - [ ] A Colab notebook link in the PR description which matches the outputs of the implemented backbone model with the original source \[[Example](https://colab.research.google.com/drive/1SeZWJorKWmwWJax8ORSdxKrxE25BfhHa?usp=sharing)\]. ### Step 3: PR #2 - Add XXTokenizer -- [ ] An `xx/xx_tokenizer.py` file which has the tokenizer for the model \[[Example](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/src/models/distil_bert/distil_bert_tokenizer.py)\]. -- [ ] An `xx/xx_tokenizer_test.py` file which has unit tests for the model tokenizer \[[Example](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/src/models/distil_bert/distil_bert_tokenizer_test.py)\]. +- [ ] An `xx/xx_tokenizer.py` file which has the tokenizer for the model \[[Example](https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/distil_bert/distil_bert_tokenizer.py)\]. +- [ ] An `xx/xx_tokenizer_test.py` file which has unit tests for the model tokenizer \[[Example](https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/distil_bert/distil_bert_tokenizer_test.py)\]. - [ ] A Colab notebook link in the PR description, demonstrating that the output of the tokenizer matches the original tokenizer \[[Example](https://colab.research.google.com/drive/1MH_rpuFB1Nz_NkKIAvVtVae2HFLjXZDA?usp=sharing)]. ### Step 4: PR #3 - Add XX Presets -- [ ] An `xx/xx_presets.py` file with links to weights uploaded to a personal GCP bucket/Google Drive \[[Example](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/src/models/distil_bert/distil_bert_presets.py)\]. -- [ ] A `tools/checkpoint_conversion/convert_xx_checkpoints.py` which is reusable script for converting checkpoints \[[Example](https://github.com/keras-team/keras-nlp/blob/master/tools/checkpoint_conversion/convert_distilbert_checkpoints.py)\]. +- [ ] An `xx/xx_presets.py` file with links to weights uploaded to a personal GCP bucket/Google Drive \[[Example](https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/distil_bert/distil_bert_presets.py)\]. +- [ ] A `tools/checkpoint_conversion/convert_xx_checkpoints.py` which is reusable script for converting checkpoints \[[Example](https://github.com/keras-team/keras-hub/blob/master/tools/checkpoint_conversion/convert_distilbert_checkpoints.py)\]. - [ ] A Colab notebook link in the PR description, showing an end-to-end task such as text classification, etc. The task model can be built using the backbone model, with the task head on top \[[Example](https://gist.github.com/mattdangerw/bf0ca07fb66b6738150c8b56ee5bab4e)\]. ### Step 5: PR #4 and Beyond - Add XX Tasks and Preprocessors This PR is optional. -- [ ] An `xx/xx_.py` file for adding a task model like classifier, masked LM, etc. \[[Example](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/src/models/distil_bert/distil_bert_classifier.py)\] -- [ ] An `xx/xx__preprocessor.py` file which has the preprocessor and can be used to get inputs suitable for the task model \[[Example](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/src/models/distil_bert/distil_bert_preprocessor.py)\]. -- [ ] `xx/xx__test.py` file and `xx/xx__preprocessor_test.py` files which have unit tests for the above two modules \[[Example 1](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/src/models/distil_bert/distil_bert_classifier_test.py) and [Example 2](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/src/models/distil_bert/distil_bert_preprocessor_test.py)\]. +- [ ] An `xx/xx_.py` file for adding a task model like classifier, masked LM, etc. \[[Example](https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/distil_bert/distil_bert_classifier.py)\] +- [ ] An `xx/xx__preprocessor.py` file which has the preprocessor and can be used to get inputs suitable for the task model \[[Example](https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/distil_bert/distil_bert_preprocessor.py)\]. +- [ ] `xx/xx__test.py` file and `xx/xx__preprocessor_test.py` files which have unit tests for the above two modules \[[Example 1](https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/distil_bert/distil_bert_classifier_test.py) and [Example 2](https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/distil_bert/distil_bert_preprocessor_test.py)\]. - [ ] A Colab notebook link in the PR description, demonstrating that the output of the preprocessor matches the output of the original preprocessor \[[Example](https://colab.research.google.com/drive/1GFFC7Y1I_2PtYlWDToqKvzYhHWv1b3nC?usp=sharing)]. ## Detailed Instructions @@ -54,7 +54,7 @@ This section discusses, in details, every necessary step. ### Step 1: Open an issue/Find an open issue Before getting started with the code, it's important to check if there are any -[open issues](https://github.com/keras-team/keras-nlp/issues?q=is%3Aissue+is%3Aopen+label%3Amodel-contribution) +[open issues](https://github.com/keras-team/keras-hub/issues?q=is%3Aissue+is%3Aopen+label%3Amodel-contribution) related to the model you wish to contribute. If there is an open issue, you can claim it by commenting on the issue and letting us know that you're interested in working on it. This helps us keep track of who is working on what and avoid @@ -81,7 +81,7 @@ around by a class to implement our models. A model is typically split into three/four sections. We would recommend you to compare this side-by-side with the -[`keras_hub.layers.DistilBertBackbone` source code](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/src/models/distil_bert/distil_bert_backbone.py)! +[`keras_hub.layers.DistilBertBackbone` source code](https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/distil_bert/distil_bert_backbone.py)! **Inputs to the model** @@ -117,13 +117,13 @@ This is when things might slightly get complicated. If the model introduces a paradigm shift, such as using relative attention instead of vanilla attention, the contributor will have to implement complete custom layers. A case in point is `keras_hub.models.DebertaV3Backbone` where we had to [implement layers -from scratch](https://github.com/keras-team/keras-nlp/tree/master/keras_hub/models/deberta_v3). +from scratch](https://github.com/keras-team/keras-hub/tree/master/keras_hub/models/deberta_v3). On the other hand, if the model has a small tweak, something simpler can be done. For instance, in the Whisper model, the self-attention and cross-attention mechanism is exactly the same as vanilla attention, with the exception that the key projection layer does not have a bias term. In this case, we can inherit the custom layer -from one of the standard layers and make minor modifications. See [this PR](https://github.com/keras-team/keras-nlp/pull/801/files#diff-8533ae3a7755c0dbe95ccbb71f85c677297f687bf3884fadefc64f1d0fdce51aR22) for +from one of the standard layers and make minor modifications. See [this PR](https://github.com/keras-team/keras-hub/pull/801/files#diff-8533ae3a7755c0dbe95ccbb71f85c677297f687bf3884fadefc64f1d0fdce51aR22) for more details. Since the first PR is only to add the model backbone class, you should omit the @@ -165,7 +165,7 @@ All the underlying actual tokenization will be taken care of by the superclass. The important thing here is adding "special tokens". Most models have special tokens such as beginning-of-sequence token, end-of-sequence token, mask token, pad token, etc. These have to be -[added as member attributes](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/src/models/distil_bert/distil_bert_tokenizer.py#L91-L105) +[added as member attributes](https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/distil_bert/distil_bert_tokenizer.py#L91-L105) to the tokenizer class. These member attributes are then accessed by the preprocessor layers. @@ -193,7 +193,7 @@ files. These files will then be uploaded to GCP by us! After wrapping up the preset configuration file, you need to add the `from_preset` function to all three classes, i.e., `DistilBertBackbone`, and `DistilBertTokenizer`. Here is an -[example](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/src/models/distil_bert/distil_bert_backbone.py#L187-L189). +[example](https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/distil_bert/distil_bert_backbone.py#L187-L189). The testing for presets is divided into two: "large" and "extra large". For "large" tests, we pick the smallest preset (in terms of number of parameters) @@ -228,9 +228,9 @@ and return the dictionary in the form expected by the model. The preprocessor class might have a few intricacies depending on the model. For example, the DeBERTaV3 tokenizer does not have the `[MASK]` in the provided sentencepiece -proto file, and we had to make some modifications [here](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/models/deberta_v3/deberta_v3_preprocessor.py). Secondly, we have +proto file, and we had to make some modifications [here](https://github.com/keras-team/keras-hub/blob/master/keras_hub/models/deberta_v3/deberta_v3_preprocessor.py). Secondly, we have a separate preprocessor class for every task. This is because different tasks -might require different input formats. For instance, we have a [separate preprocessor](https://github.com/keras-team/keras-nlp/blob/master/keras_hub/src/models/distil_bert/distil_bert_masked_lm_preprocessor.py) +might require different input formats. For instance, we have a [separate preprocessor](https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/distil_bert/distil_bert_masked_lm_preprocessor.py) for masked language modeling (MLM) for DistilBERT. ## Conclusion diff --git a/README.md b/README.md index 7d84b04215..f09034b5e2 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # KerasNLP: Multi-framework NLP Models -[![](https://github.com/keras-team/keras-nlp/workflows/Tests/badge.svg?branch=master)](https://github.com/keras-team/keras-nlp/actions?query=workflow%3ATests+branch%3Amaster) +[![](https://github.com/keras-team/keras-hub/workflows/Tests/badge.svg?branch=master)](https://github.com/keras-team/keras-hub/actions?query=workflow%3ATests+branch%3Amaster) ![Python](https://img.shields.io/badge/python-v3.9.0+-success.svg) -[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/keras-team/keras-nlp/issues) +[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/keras-team/keras-hub/issues) > [!IMPORTANT] > 📢 KerasNLP is becoming KerasHub! 📢 Read -> [the announcement](https://github.com/keras-team/keras-nlp/issues/1831). +> [the announcement](https://github.com/keras-team/keras-hub/issues/1831). > > We have renamed the repo to KerasHub in preparation for the release, but have not yet > released the new package. Follow the announcement for news. @@ -45,7 +45,7 @@ We welcome contributions. - [Roadmap](ROADMAP.md) - [Style Guide](STYLE_GUIDE.md) - [API Design Guide](API_DESIGN_GUIDE.md) -- [Call for Contributions](https://github.com/keras-team/keras-nlp/issues?q=is%3Aissue+is%3Aopen+label%3A%22contributions+welcome%22) +- [Call for Contributions](https://github.com/keras-team/keras-hub/issues?q=is%3Aissue+is%3Aopen+label%3A%22contributions+welcome%22) ## Quickstart @@ -156,7 +156,7 @@ Here is the BibTeX entry: author={Watson, Matthew, and Qian, Chen, and Bischof, Jonathan and Chollet, Fran\c{c}ois and others}, year={2022}, - howpublished={\url{https://github.com/keras-team/keras-nlp}}, + howpublished={\url{https://github.com/keras-team/keras-hub}}, } ``` @@ -164,6 +164,6 @@ Here is the BibTeX entry: Thank you to all of our wonderful contributors! - - + + diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index 000a0d9476..4e8da967c5 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -25,10 +25,10 @@ Use the following steps to create an `X.Y.0` release. `rX.Y` for each minor release. We need to set this up. If you have not, please set - `upstream` as `keras-team/keras-nlp` by running: + `upstream` as `keras-team/keras-hub` by running: ```shell - git remote add upstream https://github.com/keras-team/keras-nlp.git + git remote add upstream https://github.com/keras-team/keras-hub.git ``` From the master branch, create a new branch with a name matching the first @@ -48,7 +48,7 @@ Use the following steps to create an `X.Y.0` release. of the package. Development releases will have version numbers like `X.Y.0.dev0`, and critically will never be installed by default by `pip`. - Make a PR following [this template]([https://github.com/keras-team/keras-nlp/pull/456/files](https://github.com/keras-team/keras-nlp/pull/1638)) + Make a PR following [this template]([https://github.com/keras-team/keras-hub/pull/456/files](https://github.com/keras-team/keras-hub/pull/1638)) to update the our version number fo look like `X.Y.0.dev0`. This PR should base off our new release branch instead of the master branch. You can use the following commands: @@ -65,7 +65,7 @@ Use the following steps to create an `X.Y.0` release. branch, and ask someone to review. 3. On github, we can now create the `X.Y.0.dev0` release. Use - [this link](https://github.com/keras-team/keras-nlp/releases/new) to kick it + [this link](https://github.com/keras-team/keras-hub/releases/new) to kick it off. This release should be titled `X.Y.0.dev0`, and create a new tag with the @@ -162,7 +162,7 @@ to push certain fixes out to our users. of the package. Development releases will have version numbers like `X.Y.Z.dev0`, and critically will never be installed by default by `pip`. - Make a PR following [this template](https://github.com/keras-team/keras-nlp/pull/456/files) + Make a PR following [this template](https://github.com/keras-team/keras-hub/pull/456/files) to update the our version number fo look like `X.Y.Z.dev0`. This PR should base off our new release branch. You can use the following commands. @@ -178,7 +178,7 @@ to push certain fixes out to our users. someone to review. 3. On github, we can now create the `X.Y.Z.dev0` release. Use - [this link](https://github.com/keras-team/keras-nlp/releases/new). + [this link](https://github.com/keras-team/keras-hub/releases/new). This release should be titled `X.Y.Z.dev0`, and create a new tag with the same name on publish. Refer to the screenshot above for details on the diff --git a/SECURITY.md b/SECURITY.md index 09b1bcfe83..beb1ba7ee2 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -7,7 +7,7 @@ used before a patch is released. You may submit the report in the following ways: -- send a [private vulnerability report](https://github.com/keras-team/keras-nlp/security/advisories/new) +- send a [private vulnerability report](https://github.com/keras-team/keras-hub/security/advisories/new) Please provide the following information in your report: diff --git a/keras_hub/src/models/seq_2_seq_lm.py b/keras_hub/src/models/seq_2_seq_lm.py index 6eb52540c3..998be8e906 100644 --- a/keras_hub/src/models/seq_2_seq_lm.py +++ b/keras_hub/src/models/seq_2_seq_lm.py @@ -51,4 +51,4 @@ class Seq2SeqLM(CausalLM): ``` """ - # TODO: fill in during https://github.com/keras-team/keras-nlp/pull/1425 + # TODO: fill in during https://github.com/keras-team/keras-hub/pull/1425 diff --git a/setup.py b/setup.py index c694137b81..70e5ebfc4d 100644 --- a/setup.py +++ b/setup.py @@ -50,7 +50,7 @@ def get_version(rel_path): long_description=README, long_description_content_type="text/markdown", version=VERSION, - url="https://github.com/keras-team/keras-nlp", + url="https://github.com/keras-team/keras-hub", author="Keras team", author_email="keras-hub@google.com", license="Apache License 2.0", diff --git a/tools/checkpoint_training/bert_tiny_uncased_en_sst2_training.ipynb b/tools/checkpoint_training/bert_tiny_uncased_en_sst2_training.ipynb index 0ef7a128c8..0ecf49612b 100644 --- a/tools/checkpoint_training/bert_tiny_uncased_en_sst2_training.ipynb +++ b/tools/checkpoint_training/bert_tiny_uncased_en_sst2_training.ipynb @@ -45,7 +45,7 @@ } ], "source": [ - "!pip install -q git+https://github.com/keras-team/keras-nlp.git tensorflow --upgrade" + "!pip install -q git+https://github.com/keras-team/keras-hub.git tensorflow --upgrade" ] }, {