Giter VIP home page Giter VIP logo

lavi-bridge's People

Contributors

shihaozhaozsh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lavi-bridge's Issues

sdxl support?

i dug through some of scripts and did not find any support for sdxl based models. great work but i would love to see some support for sdxl not just 1.4/1.5 based models!
thank you for your amazing work!

Error run inference t5_unet

I have error when I run code, how to fix:

(lavi-bridge) user@hg-ai-02:/hdd/trungnn/LaVi-Bridge/test$ bash run.sh
/home/user/miniconda3/envs/lavi-bridge/lib/python3.10/site-packages/transformers/models/t5/tokenization_t5_fast.py:160: FutureWarning: This tokenizer was incorrectly instantiated with a model max length of 512 which will be corrected in Transformers v5.
For now, this behavior is kept to avoid breaking backwards compatibility when padding/encoding with truncation is True.

  • Be aware that you SHOULD NOT rely on t5-large automatically truncating your input to 512 when padding/encoding.
  • If you want to encode/pad to sequences longer than 512 you can either instantiate this tokenizer with model_max_length or pass max_length when encoding/padding.
  • To avoid this warning, please instantiate this tokenizer with model_max_length set to your preferred value.
    warnings.warn(
    Traceback (most recent call last):
    File "/hdd/trungnn/LaVi-Bridge/test/t5_unet.py", line 116, in
    main(args, prompts)
    File "/hdd/trungnn/LaVi-Bridge/test/t5_unet.py", line 46, in main
    monkeypatch_or_replace_lora_extended(
    File "/hdd/trungnn/LaVi-Bridge/test/../modules/lora.py", line 780, in monkeypatch_or_replace_lora_extended
    _module._modules[name] = _tmp
    UnboundLocalError: local variable '_tmp' referenced before assignment

Also, I have error when create conda with LaVi-Bridge/environment.yaml:
The conflict is caused by:
The user requested huggingface-hub==0.17.3
diffusers 0.24.0 depends on huggingface-hub>=0.19.4

lora weight

When I run the code:
`
TEXT_ENCODER_REPLACE_MODULES = {"LlamaAttention"}
tokenizer = LlamaTokenizer.from_pretrained(llama2_dir)
text_encoder = LlamaForCausalLM.from_pretrained(llama2_dir, torch_dtype=torch.float16).to(device)
tokenizer.pad_token = '[PAD]'
text_encoder.eval()

tokenizer.model_max_length = 256

text_encoder_lora_params, _ = inject_trainable_lora_extended(
text_encoder,
r=32,
target_replace_module=TEXT_ENCODER_REPLACE_MODULES,
# loras=None, # path to lora .pt
)
`

then, I print text_encoder_lora_params, and get "[]" a null dict.

Training and Fine-tuning hardware requirements

Exciting paper! Thank you for doing this research and publishing it.

Do you want to share some insight on what type of compute is required for training LaVi-Bridge?

Since you've used around 2M text-image pairs to train this, it sounds like you'd need a cluster of GPUs to train this from scratch (please correct me if I'm wrong!). Is finetuning the adapter and LoRAs something that can be performed on a smaller, domain-specific dataset? I would be curious to know what kind of compute that would require.

Thanks!

"nan" loss

when I test llama2+transformer, I always get a nan loss after few hundred steps.
Could you give me some advices?

Use CLIP as text encoder

Thanks for your great contribution to the Community.

I found that the experiment that uses CLIP as text encoder has been conducted in the paper, but I didn't find the corresponding code. Will you release the CLIP version code? I wonder how to deal with the linear layer of the attention layer in CLIP text encoder. Because it seems that the linear layer of the attention layer in CLIP is NonDynamicallyQuantizableLinear, not normal nn.Linear.

the resoult is not good by combining llama2 and sd

thanks for sharing this good project. i want to generate the picture by using language model.
i download the llama2-7b and the adapter as provided, but the resoult i got is not as good as the paper shows. so i want to know what's the precision about llama2-7b and sd-v1.4 models. i can see the code that is using llama2-7b in fp16, but not sure for the vae and u-net ,
i tested in fp32 and fp16, the picture style and detail is pretty strange.

Training data preprocessing

"To prepare the training data, the caption file should be organized in the following format, where each line contains the image path and its corresponding caption separated by a tab (\t):
image_path1 caption1
image_path2 caption2
...
"
Can you list examples so that we can understand and pre-process the data?

residual connection

Hi~
Do you have a try to use a residual connection between t5 embedding and adapter output?

llama-2-7b no config.json file error

I am getting an error
../llama-2-7b does not appear to have a file named config.json
this file doesn't appear in the llama2 repository or model download link. How do I fix?

train process problem

Hi, I used your code to train SD+T5 on my own.
However, the results deteriorated rapidly after only 500 steps.
validation_500_d70a7c28fc6425ca27f8 (1)
Here's what the training loss looks like:
屏幕截图 2024-03-26 175456
Do you have any advice? I tried changing the learning rate to 1e-5, but it didn't solve the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.