Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import TFAutoModelForImageClassification, AutoFeatureExtractor
|
| 3 |
from PIL import Image
|
| 4 |
import numpy as np
|
| 5 |
|
| 6 |
# Load the model and feature extractor
|
| 7 |
-
model = TFAutoModelForImageClassification.from_pretrained("willco-afk/tree-test")
|
| 8 |
feature_extractor = AutoFeatureExtractor.from_pretrained(model.config._name_or_path)
|
| 9 |
|
|
|
|
| 10 |
# Streamlit UI
|
| 11 |
st.title("Christmas Tree Classifier")
|
| 12 |
st.write("Upload an image of a Christmas tree to classify it:")
|
|
|
|
| 1 |
+
import os
|
| 2 |
import streamlit as st
|
| 3 |
from transformers import TFAutoModelForImageClassification, AutoFeatureExtractor
|
| 4 |
from PIL import Image
|
| 5 |
import numpy as np
|
| 6 |
|
| 7 |
# Load the model and feature extractor
|
| 8 |
+
model = TFAutoModelForImageClassification.from_pretrained(os.environ.get("MODEL_ID", "willco-afk/tree-test-x"))
|
| 9 |
feature_extractor = AutoFeatureExtractor.from_pretrained(model.config._name_or_path)
|
| 10 |
|
| 11 |
+
|
| 12 |
# Streamlit UI
|
| 13 |
st.title("Christmas Tree Classifier")
|
| 14 |
st.write("Upload an image of a Christmas tree to classify it:")
|