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

Upgrade Flax NNX Gemma Sampling Inference doc #4325

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

8bitmp3
Copy link
Collaborator

@8bitmp3 8bitmp3 commented Oct 23, 2024

Preview: https://flax--4325.org.readthedocs.build/en/4325/guides/gemma.html

Also fixes broken code after:

! git clone https://github.com/google/flax.git flax_examples
...
- sys.path.append("./flax_examples/flax/nnx/examples/gemma")
+ sys.path.append("./flax_examples/examples/gemma")
...

@8bitmp3 8bitmp3 requested review from cgarciae and IvyZX October 23, 2024 21:25
@8bitmp3 8bitmp3 self-assigned this Oct 23, 2024
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

docs_nnx/guides/gemma.ipynb Outdated Show resolved Hide resolved
docs_nnx/guides/gemma.ipynb Outdated Show resolved Hide resolved
docs_nnx/guides/gemma.ipynb Outdated Show resolved Hide resolved
docs_nnx/guides/gemma.ipynb Outdated Show resolved Hide resolved
docs_nnx/guides/gemma.ipynb Outdated Show resolved Hide resolved
docs_nnx/guides/gemma.ipynb Outdated Show resolved Hide resolved
docs_nnx/guides/gemma.ipynb Outdated Show resolved Hide resolved
docs_nnx/guides/gemma.ipynb Outdated Show resolved Hide resolved
docs_nnx/guides/gemma.ipynb Outdated Show resolved Hide resolved
docs_nnx/guides/gemma.ipynb Outdated Show resolved Hide resolved
@8bitmp3
Copy link
Collaborator Author

8bitmp3 commented Oct 23, 2024

Sampler configuration (https://github.com/google/flax/blob/main/examples/gemma/sampler.py):

    transformer=transformer,
    vocab=vocab,
    params=params['transformer'],
)

Throws an error

TypeError                                 Traceback (most recent call last)
...
in <cell line: 1>()
----> 1 sampler = sampler_lib.Sampler(
      2     transformer=transformer,
      3     vocab=vocab,
      4     params=params['transformer'],
      5 )

TypeError: Sampler.__init__() got an unexpected keyword argument 'params'

@cgarciae PTAL

docs_nnx/guides/gemma.ipynb Outdated Show resolved Hide resolved
@8bitmp3 8bitmp3 marked this pull request as ready for review October 28, 2024 21:43
@cgarciae
Copy link
Collaborator

Hey @8bitmp3! I cleaned up this guide a little bit. Can you take a look at the new version?

@8bitmp3
Copy link
Collaborator Author

8bitmp3 commented Oct 31, 2024

thanks @cgarciae 👍
on it

@8bitmp3 8bitmp3 closed this Nov 4, 2024
@8bitmp3
Copy link
Collaborator Author

8bitmp3 commented Nov 4, 2024

Reopening after #4334 fixes

@8bitmp3 8bitmp3 reopened this Nov 4, 2024
docs_nnx/guides/gemma.ipynb Outdated Show resolved Hide resolved
@copybara-service copybara-service bot merged commit cc29a7b into google:main Dec 17, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants