ubermenchh commited on
Commit
b862c75
1 Parent(s): db05b0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -1,4 +1,13 @@
1
- from transformers import Blip2VisionConfig, Blip2QFormerConfig, OPTConfig, Blip2Config, Blip2ForConditionalGeneration, Blip2VisionModel, Blip2Processor
 
 
 
 
 
 
 
 
 
2
  from PIL import Image
3
  import requests
4
  import torch
@@ -12,7 +21,7 @@ vis_config = Blip2VisionConfig()
12
  model = Blip2VisionModel(vis_config)
13
  config_2 = model.config
14
 
15
- processor = Blip2Processor.from_pretrained('Salesforce/blip2-opt-2.7b')
16
  model = Blip2ForConditionalGeneration.from_pretrained('Salesforce/blip2-opt-2.7b')
17
 
18
  def captioning(image):
 
1
+ from transformers import (
2
+ Blip2VisionConfig,
3
+ Blip2QFormerConfig,
4
+ OPTConfig,
5
+ Blip2Config,
6
+ Blip2ForConditionalGeneration,
7
+ Blip2VisionModel,
8
+ Blip2Processor,
9
+ AutoProcessor
10
+ )
11
  from PIL import Image
12
  import requests
13
  import torch
 
21
  model = Blip2VisionModel(vis_config)
22
  config_2 = model.config
23
 
24
+ processor = AutoProcessor.from_pretrained('Salesforce/blip2-opt-2.7b')
25
  model = Blip2ForConditionalGeneration.from_pretrained('Salesforce/blip2-opt-2.7b')
26
 
27
  def captioning(image):