We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ImportError: cannot import name 'TokenAndPositionEmbedding' from 'keras_nlp.layers'
tensorflow Version: 2.17.0
keras Version: 3.5.0
keras-nlp Version: 0.0.2
from keras_nlp.layers import TokenAndPositionEmbedding, TransformerEncoder, TransformerDecoder
decoder_embedding = TokenAndPositionEmbedding(len(target_tokenizer.word_index) + 1, sequence_len, embed_dim)(decoder_input)
pip install keras-nlp==0.15.1 Collecting keras-nlp==0.15.1
Using cached keras_nlp-0.15.1-py3-none-any.whl.metadata (6.7 kB)
Requirement already satisfied: absl-py in \python\python312\lib\site-packages (from keras-nlp==0.15.1) (2.1.0)
Requirement already satisfied: numpy in \python\python312\lib\site-packages (from keras-nlp==0.15.1) (1.26.4)
Requirement already satisfied: packaging in \python\python312\lib\site-packages (from keras-nlp==0.15.1) (24.1)
Requirement already satisfied: regex in \python\python312\lib\site-packages (from keras-nlp==0.15.1) (2024.9.11)
Requirement already satisfied: rich in \python\python312\lib\site-packages (from keras-nlp==0.15.1) (13.8.1)
Collecting kagglehub (from keras-nlp==0.15.1) Using cached kagglehub-0.3.0-py3-none-any.whl.metadata (21 kB)
INFO: pip is looking at multiple versions of keras-nlp to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement tensorflow-text; platform_system != "Darwin" (from keras-nlp) (from versions: none)
ERROR: No matching distribution found for tensorflow-text; platform_system != "Darwin"
The text was updated successfully, but these errors were encountered:
Hi @DynTechieBibin
We recently merged KerasCV and KerasNLP into KerasHub. Could you try importing it from keras_hub.layers? I believe it should work (code ref).
keras_hub.layers
Sorry, something went wrong.
This issue is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you.
sachinprasadhs
No branches or pull requests
ImportError: cannot import name 'TokenAndPositionEmbedding' from 'keras_nlp.layers'
Packages installed (Windows OS)
tensorflow Version: 2.17.0
keras Version: 3.5.0
keras-nlp Version: 0.0.2
Code:
from keras_nlp.layers import TokenAndPositionEmbedding, TransformerEncoder, TransformerDecoder
decoder_embedding = TokenAndPositionEmbedding(len(target_tokenizer.word_index) + 1, sequence_len, embed_dim)(decoder_input)
Tried:
pip install keras-nlp==0.15.1
Collecting keras-nlp==0.15.1
Using cached keras_nlp-0.15.1-py3-none-any.whl.metadata (6.7 kB)
Requirement already satisfied: absl-py in \python\python312\lib\site-packages (from keras-nlp==0.15.1) (2.1.0)
Requirement already satisfied: numpy in \python\python312\lib\site-packages (from keras-nlp==0.15.1) (1.26.4)
Requirement already satisfied: packaging in \python\python312\lib\site-packages (from keras-nlp==0.15.1) (24.1)
Requirement already satisfied: regex in \python\python312\lib\site-packages (from keras-nlp==0.15.1) (2024.9.11)
Requirement already satisfied: rich in \python\python312\lib\site-packages (from keras-nlp==0.15.1) (13.8.1)
Collecting kagglehub (from keras-nlp==0.15.1)
Using cached kagglehub-0.3.0-py3-none-any.whl.metadata (21 kB)
INFO: pip is looking at multiple versions of keras-nlp to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement tensorflow-text; platform_system != "Darwin" (from keras-nlp) (from versions: none)
ERROR: No matching distribution found for tensorflow-text; platform_system != "Darwin"
The text was updated successfully, but these errors were encountered: