Skip to content

Commit

Permalink
Add lora example to GemmaCausalLM docstring.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamanehSaadat committed Mar 27, 2024
1 parent 316f18c commit 71029eb
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 @@ -97,6 +97,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 71029eb

Please sign in to comment.