Spaces:
Sleeping
Sleeping
update app
Browse files
app.py
CHANGED
@@ -5,15 +5,20 @@ from tqdm import tqdm
|
|
5 |
|
6 |
st.title("Coffe machine captioning app")
|
7 |
|
8 |
-
|
|
|
|
|
9 |
|
10 |
-
|
11 |
|
12 |
-
|
13 |
-
|
14 |
|
15 |
-
st.success('Model loaded!')
|
16 |
-
|
|
|
|
|
|
|
17 |
|
18 |
|
19 |
# Instructions for Tesseract OCR
|
|
|
5 |
|
6 |
st.title("Coffe machine captioning app")
|
7 |
|
8 |
+
@st.cache_resource()
|
9 |
+
def load_model():
|
10 |
+
with st.spinner('Loading model and tokenizer...'):
|
11 |
|
12 |
+
model_id = "Fer14/paligemma_coffe_machine_caption"
|
13 |
|
14 |
+
model = PaliGemmaForConditionalGeneration.from_pretrained(model_id)
|
15 |
+
processor = PaliGemmaProcessor.from_pretrained(model_id)
|
16 |
|
17 |
+
st.success('Model loaded!')
|
18 |
+
return model, processor
|
19 |
+
|
20 |
+
|
21 |
+
model, processor = load_model()
|
22 |
|
23 |
|
24 |
# Instructions for Tesseract OCR
|