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

Update README.md #66

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update README.md #66

wants to merge 1 commit into from

Conversation

shmishra99
Copy link
Owner

Environment:
OS: windows 10
python version 3.12.2
pip 24.0
had never install tensorflow , keras or keras_nlp
I try to run following commands to install keras_nlp and keras following this introduction.

pip install -U keras-nlp
pip install -U keras
Command run successed. But the kerasNLP I installed seems have incorrect content, keras_nlp_init which supposed to have many models over here.

Here is the demo which I want to test.

import keras_nlp
import os
os.environ["KERAS_BACKEND"] = "tensorflow"

gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset("gemma_instruct_7b_en")
gotA = gemma_lm.generate("Keras is a", max_length=30)

print(gotA)

Generate with batched prompts.

gotB = gemma_lm.generate(["Keras is a", "I want to say"], max_length=30)

print(gotB)
Program always shutdown with following log:

2024-02-25 23:23:39.045761: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
2024-02-25 23:23:39.504814: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
Traceback (most recent call last):
File "d:\llm_demo\gemma.py", line 5, in
gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset("gemma_instruct_7b_en")
^^^^^^^^^^^^^^^^
AttributeError: module 'keras_nlp' has no attribute 'models'
If there any thing I can do to make this demo work?

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.

1 participant