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

Buggy BloomCausalLM text generation #1833

Open
ashep29 opened this issue Sep 15, 2024 · 0 comments
Open

Buggy BloomCausalLM text generation #1833

ashep29 opened this issue Sep 15, 2024 · 0 comments
Assignees
Labels
type:Bug Something isn't working

Comments

@ashep29
Copy link

ashep29 commented Sep 15, 2024

Running a very simple NLP pipeline in google colab, using BloomCausalLM as illustrated below, with versions as follows:

Tensorflow 2.17.0
Keras 3.4.1
Keras-NLP 0.15.0

Relevant code:

chosen_preset = "bloom_560m_multi"
max_length=70

bloom = keras_nlp.models.BloomCausalLM.from_preset(chosen_preset)

Downloading from https://www.kaggle.com/api/v1/models/keras/bloom/keras/bloom_560m_multi/3/download/config.json...
100%|██████████| 491/491 [00:00<00:00, 190kB/s]
Downloading from https://www.kaggle.com/api/v1/models/keras/bloom/keras/bloom_560m_multi/3/download/model.weights.h5...
100%|██████████| 1.04G/1.04G [00:12<00:00, 88.6MB/s]
Downloading from https://www.kaggle.com/api/v1/models/keras/bloom/keras/bloom_560m_multi/3/download/tokenizer.json...
100%|██████████| 453/453 [00:00<00:00, 196kB/s]
Downloading from https://www.kaggle.com/api/v1/models/keras/bloom/keras/bloom_560m_multi/3/download/assets/tokenizer/vocabulary.json...
100%|██████████| 11.9M/11.9M [00:00<00:00, 38.6MB/s]
Downloading from https://www.kaggle.com/api/v1/models/keras/bloom/keras/bloom_560m_multi/3/download/assets/tokenizer/merges.txt...
100%|██████████| 3.98M/3.98M [00:00<00:00, 16.1MB/s]

bloom.generate("The quick brown fox", max_length=max_length)
START OUTPUT:
The quick brown fox jumps over the lazy dog.]

[Illustration]

[Illustration]

[Illustration]

[Illustration]

[Illustration]

[Illustration]

[Illustration]

[Illustration]

[Illustration]

[Illustration]

[Illustration]

[Illustr

END OUTPUT:

sentence_starters = ["I don't like", "I think","this is"]
output = bloom.generate(sentence_starters,max_length=max_length)

for sentence in output:
  print(f"-->{sentence}\n")

START OUTPUT:
-->I don't like it.", "black");
const int i = 0;
while(true)
{
if(i != 3)
{
// printf("%d, ", i);
i -= 3;
printf("%d, ", i);
}
else
{
printf(

-->I think it was the same time I started my blog in 2006. I had a lot of friends and family who loved to read about my life and my work. I was very lucky because I had an amazing network of friends who were very interested in what we wrote. I have been lucky to have many of my friends who are very passionate

-->this is the id of the user', 'staff', 'staff', '', ''), '');
}

if ($('#edit').prop('checked')) {
    $('#edit').prop('checked', false).show();
    // show edit form
    $('#edit'

END OUTPUT:

Is this behaviour intentional, or is there something wrong with the model?

Any insights appreciated!

@mehtamansi29 mehtamansi29 added the type:Bug Something isn't working label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants