Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,6 @@ from transformers import BlipProcessor, BlipForConditionalGeneration
|
|
| 20 |
from PIL import Image
|
| 21 |
import torch
|
| 22 |
import json
|
| 23 |
-
|
| 24 |
|
| 25 |
# Load model and processor
|
| 26 |
processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
|
|
@@ -33,8 +32,6 @@ def caption_image(image):
|
|
| 33 |
caption = processor.decode(out[0], skip_special_tokens=True)
|
| 34 |
return caption
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
# Load model on CPU (no CUDA)
|
| 39 |
pipe = StableDiffusionPipeline.from_pretrained(
|
| 40 |
"CompVis/stable-diffusion-v1-4",
|
|
|
|
| 20 |
from PIL import Image
|
| 21 |
import torch
|
| 22 |
import json
|
|
|
|
| 23 |
|
| 24 |
# Load model and processor
|
| 25 |
processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-base")
|
|
|
|
| 32 |
caption = processor.decode(out[0], skip_special_tokens=True)
|
| 33 |
return caption
|
| 34 |
|
|
|
|
|
|
|
| 35 |
# Load model on CPU (no CUDA)
|
| 36 |
pipe = StableDiffusionPipeline.from_pretrained(
|
| 37 |
"CompVis/stable-diffusion-v1-4",
|