greencatted commited on
Commit
17f7d43
1 Parent(s): 884169d

Use Transformers

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,9 +1,10 @@
1
  import streamlit as st
2
  from PIL import Image
3
- from transformers import BlipProcessor, BlipForConditionalGeneration
4
 
5
- processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-large")
6
- model = BlipForConditionalGeneration.from_pretrained("Salesforce/blip-image-captioning-large")
 
 
7
 
8
  enable = st.checkbox("Enable camera")
9
  picture = st.camera_input("Take a picture", disabled=not enable)
 
1
  import streamlit as st
2
  from PIL import Image
 
3
 
4
+ from transformers import AutoProcessor, AutoModelForImageTextToText
5
+
6
+ processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-large")
7
+ model = AutoModelForImageTextToText.from_pretrained("Salesforce/blip-image-captioning-large")
8
 
9
  enable = st.checkbox("Enable camera")
10
  picture = st.camera_input("Take a picture", disabled=not enable)