davanstrien HF staff commited on
Commit
d1625ff
1 Parent(s): 0114d4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -7,11 +7,11 @@ api = hf_api.HfApi()
7
  flyswot_models = ModelFilter(author="flyswot")
8
  models = api.list_models(filter=flyswot_models)
9
  models = [model.modelId for model in models]
10
- choices = gr.inputs.Dropdown(choices=models, default='flyswot/convnext-tiny-224_flyswot',label="Model")
11
 
 
12
 
13
- def predict(image,model):
14
- pipe = pipeline("image-classification", model=model)
15
  predictions = pipe(image, top_k=20)
16
  return {pred['label']: pred['score'] for pred in predictions}
17
 
 
7
  flyswot_models = ModelFilter(author="flyswot")
8
  models = api.list_models(filter=flyswot_models)
9
  models = [model.modelId for model in models]
10
+ #choices = gr.inputs.Dropdown(choices=models, default='flyswot/convnext-tiny-224_flyswot',label="Model")
11
 
12
+ pipe = pipeline("image-classification", model="flyswot/convnext-tiny-224_flyswot")
13
 
14
+ def predict(image):
 
15
  predictions = pipe(image, top_k=20)
16
  return {pred['label']: pred['score'] for pred in predictions}
17