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

Port GPT Text Generation Guide to Keras Core #1490

Closed
wants to merge 10 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions examples/generative/text_generation_gpt.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""
Title: GPT text generation from scratch with KerasNLP
Author: [Jesse Chan](https://github.com/jessechancy)
Converted to Keras Core by: [Anshuman Mishra](https://github.com/shivance)
Date created: 2022/07/25
Last modified: 2022/07/25
Last modified: 2023/08/16
Description: Using KerasNLP to train a mini-GPT model for text generation.
Accelerator: GPU
"""
Expand Down Expand Up @@ -39,7 +40,9 @@
import os
import keras_nlp
import tensorflow as tf
from tensorflow import keras
import keras_core as keras
shivance marked this conversation as resolved.
Show resolved Hide resolved

os.environ["KERAS_BACKEND"] = "tensorflow" # or "jax" or "torch"

"""
## Settings & hyperparameters
Expand Down
Loading