Spaces:
Sleeping
Sleeping
phind
commited on
Commit
·
1c6aece
1
Parent(s):
ab85c42
fix bugs
Browse files
app.py
CHANGED
@@ -2,12 +2,12 @@ import streamlit as st
|
|
2 |
from transformers import pipeline
|
3 |
from PIL import Image
|
4 |
|
5 |
-
@st.
|
6 |
def get_model_hotdog_classification_pipeline():
|
7 |
pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
8 |
return pipeline
|
9 |
|
10 |
-
@st.
|
11 |
def get_model_image_captioning_pipeline():
|
12 |
captioner = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
13 |
return captioner
|
|
|
2 |
from transformers import pipeline
|
3 |
from PIL import Image
|
4 |
|
5 |
+
@st.cache_resource
|
6 |
def get_model_hotdog_classification_pipeline():
|
7 |
pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")
|
8 |
return pipeline
|
9 |
|
10 |
+
@st.cache_resource
|
11 |
def get_model_image_captioning_pipeline():
|
12 |
captioner = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
13 |
return captioner
|