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

Typo in the README.md for janus-flow text-to-image tutorial #30

Open
CiaoHe opened this issue Jan 10, 2025 · 1 comment
Open

Typo in the README.md for janus-flow text-to-image tutorial #30

CiaoHe opened this issue Jan 10, 2025 · 1 comment

Comments

@CiaoHe
Copy link

CiaoHe commented Jan 10, 2025

...
if step == 0:
    outputs = vl_gpt.language_model.model(inputs_embeds=llm_emb, 
                                     use_cache=True, 
                                     attention_mask=attention_mask,
                                     past_key_values=None)
    past_key_values = []
    for kv_cache in past_key_values: # here, should be `outputs.past_key_values` ?
        k, v = kv_cache[0], kv_cache[1]
        past_key_values.append((k[:, :, :inputs_embeds.shape[1], :], v[:, :, :inputs_embeds.shape[1], :]))
    past_key_values = tuple(past_key_values)
...
@clivinn-shla81092
Copy link

Hello, we tried to solve the issue.

This is what we did:

Updated the generate function to correctly handle past_key_values from the model outputs. This fixes the issue where past_key_values was incorrectly initialized and not using the output from the model.

You can review changes in this commit: clivinn-shla81092@25e1a7d.

Caution

Disclaimer: The concept of solution was created by AI and you should never copy paste this code before you check the correctness of generated code. Solution might not be complete, you should use this code as an inspiration only.


Latta AI seeks to solve problems in open source projects as part of its mission to support developers around the world. Learn more about our mission at https://latta.ai/ourmission . If you no longer want Latta AI to attempt solving issues on your repository, you can block this account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants