Spaces:
Runtime error
Runtime error
GIanlucaRub
commited on
Commit
•
d7d6d65
1
Parent(s):
05f807a
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import os
|
|
5 |
from moviepy.editor import VideoFileClip
|
6 |
|
7 |
|
8 |
-
pipe = pipeline(model="GIanlucaRub/whisper-tiny-it-
|
9 |
|
10 |
def transcribe_yt(link):
|
11 |
yt = YouTube(link)
|
@@ -41,34 +41,82 @@ with block:
|
|
41 |
|
42 |
<div style="text-align: center; max-width: 500px; margin: 0 auto;margin-top: 10px">
|
43 |
<div>
|
44 |
-
<h1 style="font-size: 400
|
45 |
</div>
|
46 |
-
<p style="margin-bottom: 10px; font-size:
|
47 |
-
Realtime demo for Italian speech recognition using a fine-tuned Whisper tiny model.
|
48 |
</p>
|
49 |
</div>
|
50 |
"""
|
51 |
)
|
52 |
with gr.Group():
|
53 |
with gr.Box():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
text = gr.Textbox(
|
55 |
label="Transcription",
|
56 |
placeholder="Transcription Output",
|
57 |
lines=5)
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
microphone=gr.Audio(source="microphone", type="filepath")
|
60 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
61 |
btn_microphone = gr.Button("Transcribe microphone audio")
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
audio_uploaded=gr.Audio(source="upload", type="filepath")
|
64 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
65 |
btn_audio_uploaded = gr.Button("Transcribe audio uploaded")
|
66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
video_uploaded = gr.Video(source = "upload")
|
68 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
69 |
btn_video_uploaded = gr.Button("Transcribe video uploaded")
|
70 |
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
link = gr.Textbox(label="YouTube Link")
|
73 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
74 |
btn_youtube = gr.Button("Transcribe Youtube video")
|
|
|
5 |
from moviepy.editor import VideoFileClip
|
6 |
|
7 |
|
8 |
+
pipe = pipeline(model="GIanlucaRub/whisper-tiny-it-9",task="automatic-speech-recognition")
|
9 |
|
10 |
def transcribe_yt(link):
|
11 |
yt = YouTube(link)
|
|
|
41 |
|
42 |
<div style="text-align: center; max-width: 500px; margin: 0 auto;margin-top: 10px">
|
43 |
<div>
|
44 |
+
<h1 style="font-size: 400%;line-height: 1.2;">Whisper Italian Automatic Speech Recognition</h1>
|
45 |
</div>
|
46 |
+
<p style="margin-bottom: 10px; font-size: 150%;margin-top: 30px;line-height: 1.2;">
|
47 |
+
Realtime demo for Italian speech recognition using a fine-tuned Whisper tiny model.You can use the model in 4 different ways.
|
48 |
</p>
|
49 |
</div>
|
50 |
"""
|
51 |
)
|
52 |
with gr.Group():
|
53 |
with gr.Box():
|
54 |
+
gr.HTML(
|
55 |
+
"""
|
56 |
+
|
57 |
+
<div style="text-align: center; max-width: 500px; margin: 0 auto;margin-top: 10px">
|
58 |
+
<p style="margin-bottom: 10px; font-size: 100%;margin-top: 10px;line-height: 1.2;">
|
59 |
+
Here you can see the transcription.
|
60 |
+
</p>
|
61 |
+
</div>
|
62 |
+
""")
|
63 |
text = gr.Textbox(
|
64 |
label="Transcription",
|
65 |
placeholder="Transcription Output",
|
66 |
lines=5)
|
67 |
+
gr.HTML(
|
68 |
+
"""
|
69 |
+
|
70 |
+
<div style="text-align: center; max-width: 500px; margin: 0 auto;margin-top: 10px">
|
71 |
+
<p style="margin-bottom: 10px; font-size: 100%;margin-top: 20px;line-height: 1.0;">
|
72 |
+
You can record audio from your microphone.
|
73 |
+
</p>
|
74 |
+
</div>
|
75 |
+
""")
|
76 |
microphone=gr.Audio(source="microphone", type="filepath")
|
77 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
78 |
btn_microphone = gr.Button("Transcribe microphone audio")
|
79 |
+
|
80 |
+
|
81 |
+
gr.HTML(
|
82 |
+
"""
|
83 |
+
|
84 |
+
<div style="text-align: center; max-width: 500px; margin: 0 auto;margin-top: 10px">
|
85 |
+
<p style="margin-bottom: 10px; font-size: 100%;margin-top: 20px;line-height: 1.2;">
|
86 |
+
You can upload an audio file.
|
87 |
+
</p>
|
88 |
+
</div>
|
89 |
+
""")
|
90 |
audio_uploaded=gr.Audio(source="upload", type="filepath")
|
91 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
92 |
btn_audio_uploaded = gr.Button("Transcribe audio uploaded")
|
93 |
|
94 |
+
|
95 |
+
|
96 |
+
gr.HTML(
|
97 |
+
"""
|
98 |
+
|
99 |
+
<div style="text-align: center; max-width: 500px; margin: 0 auto;margin-top: 10px">
|
100 |
+
<p style="margin-bottom: 10px; font-size: 100%;margin-top: 20px;line-height: 1.2;">
|
101 |
+
You can upload a video file
|
102 |
+
</p>
|
103 |
+
</div>
|
104 |
+
""")
|
105 |
video_uploaded = gr.Video(source = "upload")
|
106 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
107 |
btn_video_uploaded = gr.Button("Transcribe video uploaded")
|
108 |
|
109 |
+
|
110 |
+
|
111 |
+
gr.HTML(
|
112 |
+
"""
|
113 |
+
|
114 |
+
<div style="text-align: center; max-width: 500px; margin: 0 auto;margin-top: 10px">
|
115 |
+
<p style="margin-bottom: 10px; font-size: 100%;margin-top: 20px;line-height: 1.2;">
|
116 |
+
You can put a youtube video link
|
117 |
+
</p>
|
118 |
+
</div>
|
119 |
+
""")
|
120 |
link = gr.Textbox(label="YouTube Link")
|
121 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
122 |
btn_youtube = gr.Button("Transcribe Youtube video")
|