multimodalart HF staff commited on
Commit
4f58dd2
1 Parent(s): e20081e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -14,6 +14,7 @@ from slugify import slugify
14
  import argparse
15
  import importlib
16
  import sys
 
17
  MAX_IMAGES = 50
18
 
19
  training_script_url = "https://raw.githubusercontent.com/huggingface/diffusers/main/examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py"
@@ -23,6 +24,10 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
23
 
24
  FACES_DATASET_PATH = snapshot_download(repo_id="multimodalart/faces-prior-preservation", repo_type="dataset")
25
 
 
 
 
 
26
  processor = Blip2Processor.from_pretrained("Salesforce/blip2-opt-2.7b")
27
  model = Blip2ForConditionalGeneration.from_pretrained(
28
  "Salesforce/blip2-opt-2.7b", device_map={"": 0}, torch_dtype=torch.float16
 
14
  import argparse
15
  import importlib
16
  import sys
17
+ from pathlib import Path
18
  MAX_IMAGES = 50
19
 
20
  training_script_url = "https://raw.githubusercontent.com/huggingface/diffusers/main/examples/advanced_diffusion_training/train_dreambooth_lora_sdxl_advanced.py"
 
24
 
25
  FACES_DATASET_PATH = snapshot_download(repo_id="multimodalart/faces-prior-preservation", repo_type="dataset")
26
 
27
+ #Delete .gitattributes to process things properly
28
+ Path(FACES_DATASET_PATH, '.gitattributes').unlink(missing_ok=True)
29
+
30
+
31
  processor = Blip2Processor.from_pretrained("Salesforce/blip2-opt-2.7b")
32
  model = Blip2ForConditionalGeneration.from_pretrained(
33
  "Salesforce/blip2-opt-2.7b", device_map={"": 0}, torch_dtype=torch.float16