Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,8 +18,10 @@ from transformers import (
|
|
18 |
Trainer,
|
19 |
pipeline
|
20 |
)
|
21 |
-
processor = Wav2Vec2Processor.from_pretrained(
|
22 |
-
|
|
|
|
|
23 |
|
24 |
demo = gr.Blocks()
|
25 |
|
@@ -136,23 +138,28 @@ with demo:
|
|
136 |
text_button1 = gr.Button("Submit")
|
137 |
with gr.TabItem("From your file."):
|
138 |
with gr.Row():
|
139 |
-
file_input = gr.Audio(
|
|
|
140 |
file_output = gr.Textbox(labe="Your output is here.")
|
141 |
text_button4 = gr.Button("Submit")
|
142 |
-
|
|
|
143 |
with gr.TabItem("From youtube"):
|
144 |
with gr.Row():
|
145 |
youtube_input = gr.Textbox(
|
146 |
label="Insert your youtube link here.", placeholder='https://www.youtube.com/watch?v=dQw4w9WgXcQ')
|
147 |
youtube_output = gr.Textbox(labe="Your output is here.")
|
148 |
text_button2 = gr.Button("Submit")
|
149 |
-
|
|
|
150 |
with gr.TabItem("From twitch"):
|
151 |
with gr.Row():
|
152 |
twitch_input = gr.Textbox(label="Insert your twitch link or ID here.",
|
153 |
placeholder='https://www.twitch.tv/videos/1823056925 or 1823056925')
|
154 |
twitch_output = gr.Textbox(labe="Your output is here.")
|
155 |
text_button3 = gr.Button("Submit")
|
|
|
|
|
156 |
|
157 |
text_button1.click(process, inputs=voice, outputs=voice_output)
|
158 |
text_button2.click(youtube_loader, inputs=youtube_input,
|
@@ -161,6 +168,6 @@ with demo:
|
|
161 |
outputs=twitch_output)
|
162 |
text_button4.click(process, inputs=file_input,
|
163 |
outputs=file_output)
|
164 |
-
|
165 |
|
166 |
demo.launch(enable_queue=True)
|
|
|
18 |
Trainer,
|
19 |
pipeline
|
20 |
)
|
21 |
+
processor = Wav2Vec2Processor.from_pretrained(
|
22 |
+
"airesearch/wav2vec2-large-xlsr-53-th")
|
23 |
+
model = Wav2Vec2ForCTC.from_pretrained(
|
24 |
+
"BALAKA/wav2vec2-large-xlsr-53-th-swear-words")
|
25 |
|
26 |
demo = gr.Blocks()
|
27 |
|
|
|
138 |
text_button1 = gr.Button("Submit")
|
139 |
with gr.TabItem("From your file."):
|
140 |
with gr.Row():
|
141 |
+
file_input = gr.Audio(
|
142 |
+
type="filepath", optional=True, labe="Drop your audio file here.")
|
143 |
file_output = gr.Textbox(labe="Your output is here.")
|
144 |
text_button4 = gr.Button("Submit")
|
145 |
+
gr.Examples([["ex/ex1.mp3"], ["ex/ex2.mp3"]],
|
146 |
+
inputs=file_input, outputs=file_output, fn=process)
|
147 |
with gr.TabItem("From youtube"):
|
148 |
with gr.Row():
|
149 |
youtube_input = gr.Textbox(
|
150 |
label="Insert your youtube link here.", placeholder='https://www.youtube.com/watch?v=dQw4w9WgXcQ')
|
151 |
youtube_output = gr.Textbox(labe="Your output is here.")
|
152 |
text_button2 = gr.Button("Submit")
|
153 |
+
gr.Examples([["https://youtu.be/JwOJWFniWS8"], ["https://youtu.be/B8TvZyoucxM"]],
|
154 |
+
inputs=youtube_input, outputs=youtube_output, fn=youtube_loader)
|
155 |
with gr.TabItem("From twitch"):
|
156 |
with gr.Row():
|
157 |
twitch_input = gr.Textbox(label="Insert your twitch link or ID here.",
|
158 |
placeholder='https://www.twitch.tv/videos/1823056925 or 1823056925')
|
159 |
twitch_output = gr.Textbox(labe="Your output is here.")
|
160 |
text_button3 = gr.Button("Submit")
|
161 |
+
gr.Examples([["https://www.twitch.tv/videos/1823056925"], ["https://www.twitch.tv/videos/1827185416"]],
|
162 |
+
inputs=twitch_input, outputs=twitch_output, fn=twitch_loader)
|
163 |
|
164 |
text_button1.click(process, inputs=voice, outputs=voice_output)
|
165 |
text_button2.click(youtube_loader, inputs=youtube_input,
|
|
|
168 |
outputs=twitch_output)
|
169 |
text_button4.click(process, inputs=file_input,
|
170 |
outputs=file_output)
|
171 |
+
|
172 |
|
173 |
demo.launch(enable_queue=True)
|