nightfury commited on
Commit
c0b2cd5
1 Parent(s): 79f6f72

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -14,11 +14,11 @@ blip_model_id = "Salesforce/blip-image-captioning-base"
14
  pipe = StableDiffusionPipeline.from_pretrained(model_id)
15
  pipe = pipe.to("cpu") #cuda
16
 
17
- blip_model = BlipForConditionalGeneration.from_pretrained(blip_model_id, torch_dtype=torch.float16).to("CPU") #CUDA
18
  processor = BlipProcessor.from_pretrained(blip_model_id)
19
 
20
  def predict(image):
21
- inputs = processor(image, return_tensors="pt").to("cpu", torch.float16) #cuda
22
  output_blip = blip_model.generate(**inputs)
23
  prompt = processor.decode(output_blip[0], skip_special_tokens=True)
24
 
 
14
  pipe = StableDiffusionPipeline.from_pretrained(model_id)
15
  pipe = pipe.to("cpu") #cuda
16
 
17
+ blip_model = BlipForConditionalGeneration.from_pretrained(blip_model_id, torch_dtype=torch.float8).to("CPU") #CUDA
18
  processor = BlipProcessor.from_pretrained(blip_model_id)
19
 
20
  def predict(image):
21
+ inputs = processor(image, return_tensors="pt").to("cpu", torch.float8) #cuda
22
  output_blip = blip_model.generate(**inputs)
23
  prompt = processor.decode(output_blip[0], skip_special_tokens=True)
24