Skip to content

Commit

Permalink
Add lora example to GemmaCausalLM docstring (#1527)
Browse files Browse the repository at this point in the history
* Add lora example to GemmaCausalLM docstring.

* Address review.
  • Loading branch information
SamanehSaadat authored and abuelnasr0 committed Apr 2, 2024
1 parent e5b2833 commit 2be333c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions keras_nlp/models/gemma/gemma_causal_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ class GemmaCausalLM(GenerativeTask):
gemma_lm.fit(x=features, batch_size=2)
```
Call `fit()` with LoRA fine-tuning enabled.
```python
features = ["The quick brown fox jumped.", "I forgot my homework."]
gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset("gemma_2b_en")
gemma.backbone.enable_lora(rank=4)
gemma_lm.fit(x=features, batch_size=2)
```
Call `fit()` without preprocessing.
```python
x = {
Expand Down

0 comments on commit 2be333c

Please sign in to comment.