Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -165,9 +165,9 @@ captioner = pipeline(model="ydshieh/vit-gpt2-coco-en",device='cuda', task="image
|
|
165 |
#captioner_3 = pipeline(model="ford442/blip-image-to-text-large-bf16",device='cuda', task="image-to-text")
|
166 |
model5 = Blip2ForConditionalGeneration.from_pretrained("ford442/blip2-image-to-text-bf16").to('cuda')
|
167 |
processor5 = Blip2Processor.from_pretrained("ford442/blip2-image-to-text-bf16")
|
168 |
-
txt_tokenizer = AutoTokenizer.from_pretrained(checkpoint, device_map='
|
169 |
txt_tokenizer.tokenizer_legacy=False
|
170 |
-
model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map='
|
171 |
|
172 |
ip_model = IPAdapterXL(pipe, local_folder, ip_ckpt, device)
|
173 |
text_encoder=CLIPTextModel.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='text_encoder',token=True).to(device=device, dtype=torch.bfloat16)
|
|
|
165 |
#captioner_3 = pipeline(model="ford442/blip-image-to-text-large-bf16",device='cuda', task="image-to-text")
|
166 |
model5 = Blip2ForConditionalGeneration.from_pretrained("ford442/blip2-image-to-text-bf16").to('cuda')
|
167 |
processor5 = Blip2Processor.from_pretrained("ford442/blip2-image-to-text-bf16")
|
168 |
+
txt_tokenizer = AutoTokenizer.from_pretrained(checkpoint, device_map='cuda', add_prefix_space=False)
|
169 |
txt_tokenizer.tokenizer_legacy=False
|
170 |
+
model = AutoModelForCausalLM.from_pretrained(checkpoint, device_map='cuda') #.to('cuda')
|
171 |
|
172 |
ip_model = IPAdapterXL(pipe, local_folder, ip_ckpt, device)
|
173 |
text_encoder=CLIPTextModel.from_pretrained('ford442/RealVisXL_V5.0_BF16', subfolder='text_encoder',token=True).to(device=device, dtype=torch.bfloat16)
|