Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -140,10 +140,7 @@ def query(filename,api_url):
|
|
140 |
#API_URL = "https://api-inference.huggingface.co/models/rwcuffney/autotrain-pick_a_card-3726099224"
|
141 |
|
142 |
|
143 |
-
|
144 |
-
def predict(image):
|
145 |
-
predictions = pipeline(image)
|
146 |
-
return {p["label"]: p["score"] for p in predictions}
|
147 |
|
148 |
|
149 |
##### FORM #####
|
@@ -164,6 +161,10 @@ with st.form("api_form"):
|
|
164 |
|
165 |
submitted = st.form_submit_button("Submit")
|
166 |
if submitted:
|
|
|
|
|
|
|
|
|
167 |
prediction = predict(image)
|
168 |
st.write(prediction)
|
169 |
#st.write(API_dict[api])
|
|
|
140 |
#API_URL = "https://api-inference.huggingface.co/models/rwcuffney/autotrain-pick_a_card-3726099224"
|
141 |
|
142 |
|
143 |
+
|
|
|
|
|
|
|
144 |
|
145 |
|
146 |
##### FORM #####
|
|
|
161 |
|
162 |
submitted = st.form_submit_button("Submit")
|
163 |
if submitted:
|
164 |
+
pipeline = pipeline(task="image-classification", model="rwcuffney/autotrain-pick_a_card-3726099224")
|
165 |
+
def predict(image):
|
166 |
+
predictions = pipeline(image)
|
167 |
+
return {p["label"]: p["score"] for p in predictions}
|
168 |
prediction = predict(image)
|
169 |
st.write(prediction)
|
170 |
#st.write(API_dict[api])
|