Update app.py
Browse files
app.py
CHANGED
@@ -1,22 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
transcription = asr_pipeline(audio_input)
|
13 |
-
return transcription[0]["transcription"]
|
14 |
-
|
15 |
-
# Define Gradio interface
|
16 |
-
gr.Interface(
|
17 |
-
fn=transcribe_audio,
|
18 |
-
inputs=gr.inputs.Microphone(label="Speak into the microphone"),
|
19 |
-
outputs="text",
|
20 |
-
title="Speech-to-Text with Default Model",
|
21 |
-
description="Speak into the microphone and see the text transcription.",
|
22 |
-
).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 |
+
allow_flagging="never").launch(inbrowser=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|