abidlabs HF staff commited on
Commit
c52f02e
1 Parent(s): 7d70eb4

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +5 -3
index.html CHANGED
@@ -19,12 +19,14 @@ import gradio as gr
19
 
20
  transformers = await import_transformers_js()
21
  pipeline = transformers.pipeline
22
- pipe = await pipeline('automatic-speech-recognition')
23
 
24
  async def transcribe(text):
25
- return await pipe(text)
 
 
26
 
27
- demo = gr.Interface(transcribe, gr.Audio(source="microphone"), gr.Textbox())
28
  demo.launch()
29
  </gradio-file>
30
 
 
19
 
20
  transformers = await import_transformers_js()
21
  pipeline = transformers.pipeline
22
+ pipe = await pipeline('zero-shot-image-classification')
23
 
24
  async def transcribe(text):
25
+ data = await pipe(text)
26
+ result = [{item['label']: round(item['score'], 2) for item in data}]
27
+ return result
28
 
29
+ demo = gr.Interface(transcribe, [gr.Image("Input Image"), gr.Textbox(label="Classes")], gr.Label())
30
  demo.launch()
31
  </gradio-file>
32