rwcuffney commited on
Commit
4328bde
1 Parent(s): fb6ba9d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
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
- pipeline = pipeline(task="image-classification", model="rwcuffney/autotrain-pick_a_card-3726099224")
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])