antfraia commited on
Commit
1ecbd6e
·
1 Parent(s): 40e481e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -13
app.py CHANGED
@@ -1,21 +1,25 @@
1
- import gradio as gr
2
- import whisper
3
 
4
- def convert_to_text(audio_path : str) -> str:
5
- model = whisper.load_model("base")
6
- result = model.transcribe(audio_path)
7
- return result["text"]
8
 
 
 
 
 
 
9
 
 
 
 
 
 
10
 
11
- audio_input = gr.components.Audio(type="filepath")
12
  iface = gr.Interface(
13
- fn=convert_to_text,
14
- inputs=audio_input,
15
- outputs="text",
16
- title="Transform your audio into text",
17
- description="Upload an audio here, either from your mobile or laptop and get it transcribed in a matter of seconds.",
18
- theme="Monochrome"
19
  )
20
 
21
  iface.launch()
 
1
+ # app.py
 
2
 
3
+ import gradio as gr
 
 
 
4
 
5
+ # Custom function to return HTML output
6
+ def custom_html_output(input_text):
7
+ return {
8
+ "html": f"<div style='color: blue; border: 1px solid black; padding: 10px;'>Your input was: {input_text}</div>"
9
+ }
10
 
11
+ # Description with custom HTML
12
+ description_content = """
13
+ <b>Welcome to our Gradio App!</b><br>
14
+ For more details, check out our <a href="https://www.example.com" target="_blank">website</a>.
15
+ """
16
 
17
+ # Gradio interface
18
  iface = gr.Interface(
19
+ fn=custom_html_output,
20
+ inputs="text",
21
+ outputs={"html": "html"},
22
+ description=description_content
 
 
23
  )
24
 
25
  iface.launch()