camanalo1 commited on
Commit
adb23a2
1 Parent(s): e7cab25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -14
app.py CHANGED
@@ -1,17 +1,12 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- # Define the full path to the NeMo Canary model
5
- model_name = "nvidia/canary-1b"
6
-
7
- # Define the pipeline for speech recognition with the NeMo Canary model
8
- pipe = pipeline(
9
- task="automatic-speech-recognition",
10
- model=model_name
11
- )
12
-
13
- # Create a Gradio interface from the pipeline
14
- interface = gr.Interface.from_pipeline(pipe, inputs="microphone", outputs="text")
15
-
16
- # Launch the interface
17
- interface.launch()
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ pipe = pipeline(task="image-classification",
5
+ # model that can do 22k-category classification
6
+ model="microsoft/beit-base-patch16-224-pt22k-ft22k")
7
+ gr.Interface.from_pipeline(pipe,
8
+ title="22k Image Classification",
9
+ description="Object Recognition using Microsoft BEIT",
10
+ examples = ['wonder_cat.jpg', 'aki_dog.jpg',],
11
+ article = "Author: <a href=\"https://huggingface.co/rowel\">Rowel Atienza</a>",
12
+ ).launch()