shihaozhaozsh / lavi-bridge Goto Github PK
View Code? Open in Web Editor NEW[ECCV 2024] Bridging Different Language Models and Generative Vision Models for Text-to-Image Generation
License: MIT License
[ECCV 2024] Bridging Different Language Models and Generative Vision Models for Text-to-Image Generation
License: MIT License
In the original paper, the Transformer was never used with the LLAMA text encoder. Why is this? Was an adapter never trained for this? Are there plans to do so at some point?
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!
which llama2 version can match your released lora weights? Could you share the huggingface link of the correct llama2 version?
Can the version "https://huggingface.co/NousResearch/Llama-2-7b-hf" work well with your released lora weights?
Thanks for your reply~
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
.
model_max_length
or pass max_length
when encoding/padding.model_max_length
set to your preferred value.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
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()
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.
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!
when I test llama2+transformer, I always get a nan loss after few hundred steps.
Could you give me some advices?
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
.
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.
"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?
Hi~
Do you have a try to use a residual connection between t5 embedding and adapter output?
Hey, did you get the results from fine-tuning only the UNet part with a fixed T5 or Llama?
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.