Skip to content
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

Doc updates to switch branding to Keras 3 #1259

Merged
merged 1 commit into from
Oct 5, 2023

Conversation

mattdangerw
Copy link
Member

Make some updates to KerasNLP to reflect our changing branding, Keras 3 not Keras Core.

View the changes rendered here:
https://github.com/mattdangerw/keras-nlp/tree/doc-update

@mattdangerw mattdangerw changed the title Doc updates to try to clarify multi-backend support Doc updates to switch branding to Keras 3 Sep 27, 2023
[`Models`](https://keras.io/api/models/) that receive that same level of polish
as core Keras. If you are familiar with Keras, congratulations! You already
understand most of KerasNLP.
KerasNLP is a natural language processing library that works natively
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed trailing spaces, but I think that is making this diff look a lot bigger than it is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there's something crazy going on with the diff here. Even identical paragraphs are marked as deleted.

[`keras_nlp.models`](https://keras.io/api/keras_nlp/models/) API:

```python
import os
os.environ["KERAS_BACKEND"] = "jax" # Or "tensorflow", or "torch".
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All our guides and examples show setting KERAS_BACKEND, it seems consistent to do so here as well.

using Keras Core with the backend specified (e.g., `KERAS_BACKEND=jax`).
2. Via the `.keras/keras.json` and `.keras/keras_nlp.json` config files (which
are automatically created the first time you import KerasNLP):
- Set your backend of choice in `.keras/keras.json`; e.g., `"backend": "jax"`.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've dropped any mention of .keras json files for now. There is too much to focus on!

Let's only document KERAS_BACKEND environment variable for now, and try to make that less confusing. After Keras 3 is out, we can go back to documenting persistent settings.

Copy link
Contributor

@jbischof jbischof left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good direction! Some high level thoughts:

  1. from keras_cv.backend import keras seems less confusing that knowing to import keras_core and makes scripts less portable. I wonder if this remains a good intermediate approach.
  2. Make sure to update keras.io landing pages
  3. Please coordinate with @ianstenbit to keep KerasCV and KerasNLP documentation aligned where possible.

[`Models`](https://keras.io/api/models/) that receive that same level of polish
as core Keras. If you are familiar with Keras, congratulations! You already
understand most of KerasNLP.
KerasNLP is a natural language processing library that works natively
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, there's something crazy going on with the diff here. Even identical paragraphs are marked as deleted.

@mattdangerw
Copy link
Member Author

from keras_cv.backend import keras seems less confusing that knowing to import keras_core and makes scripts less portable. I wonder if this remains a good intermediate approach.

This is an option! Thought about it too. But I think because of our explicit API export we would need to cut a new release for this. So slightly more work.

README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@ianstenbit
Copy link
Contributor

ianstenbit commented Sep 28, 2023

This is a good direction! Some high level thoughts:

  1. from keras_cv.backend import keras seems less confusing that knowing to import keras_core and makes scripts less portable. I wonder if this remains a good intermediate approach.
  2. Make sure to update keras.io landing pages
  3. Please coordinate with @ianstenbit to keep KerasCV and KerasNLP documentation aligned where possible.

I've opened a PR on KerasCV to make ~the same changes. I've updated the important bit about importing Keras to use from keras_cv.backend import keras (for now):

"""

Important

If you want to import Keras and guarantee that you're getting the same version
that KerasCV is using, just use from keras_cv.backend import keras. This
will give you the correct version so that your custom Keras code interacts
with KerasCV correctly.
"""

@mattdangerw
Copy link
Member Author

Updated this with the small comments. I think this can probably land whenever. Though #1258 is blocked on tensorflow-text fixing it's nightly build.

@mattdangerw mattdangerw merged commit a9db112 into keras-team:master Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants