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

Google Colab version #13

Open
danieltanhx opened this issue Jul 14, 2023 · 3 comments
Open

Google Colab version #13

danieltanhx opened this issue Jul 14, 2023 · 3 comments

Comments

@danieltanhx
Copy link

To those who are struggling to replicate this. Below is the google colab version which can run on python3.10 linux google colab

!git clone https://github.com/Yujun-Shi/DragDiffusion.git
%cd /content/DragDiffusion
!pip install accelerate==0.17.0
!pip install transformers
!pip install diffusers
!pip install gradio
!pip install einops
!pip install pytorch_lightning
!mkdir /root/.cache/huggingface
!mkdir /root/.cache/huggingface/accelerate

string='''
compute_environment: LOCAL_MACHINE
deepspeed_config: {}
distributed_type: 'NO'
downcast_bf16: 'no'
dynamo_config: {}
fsdp_config: {}
gpu_ids: '0'
machine_rank: 0
main_training_function: main
megatron_lm_config: {}
mixed_precision: fp16
num_machines: 1
num_processes: 1
rdzv_backend: static
same_network: true
tpu_env: []
tpu_use_cluster: false
tpu_use_sudo: false
use_cpu: false
'''
text_file = open("/root/.cache/huggingface/accelerate/default_config.yaml", "w")
n = text_file.write(string)
text_file.close()

!bash lora/train_lora.sh
!python drag_ui_real.py

@Yujun-Shi
Copy link
Owner

By the way, now we've integrate LoRA training into the user interface, so you don't need to go through the trouble of using "lora/train_lora.sh" :)

@Bendito999
Copy link

to get the colab version working again I had to change
!pip install accelerate==0.17.0
to
!pip install accelerate==0.20.3

@uranusx86
Copy link

Here is the conda version in the Google Colab.

install condacolab package

!pip install -q condacolab
import condacolab
condacolab.install()
import sys
print(sys.executable)

clone the source code

!git clone https://github.com/Yujun-Shi/DragDiffusion.git

fix environment.yaml

%cd /content/DragDiffusion
# fix cudatoolkit not found error
!sed -i '4 a \ \ - nvidia' environment.yaml
!sed -i '4 a \ \ - conda-forge' environment.yaml

create runtime environment

!conda env create -f environment.yaml
!source /usr/local/etc/profile.d/conda.sh

install the missing package & run the demo

!source activate dragdiff && pip install ipykernel && python -m ipykernel install --user && python drag_ui.py

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

4 participants