BALAKA commited on
Commit
df18c0d
·
1 Parent(s): aaf54d0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -19,7 +19,7 @@ from transformers import (
19
  pipeline
20
  )
21
  processor = Wav2Vec2Processor.from_pretrained("airesearch/wav2vec2-large-xlsr-53-th")
22
- model = Wav2Vec2ForCTC.from_pretrained("BALAKA/wav2vec2-large-xlsr-53-thai")
23
 
24
  demo = gr.Blocks()
25
 
@@ -124,8 +124,6 @@ def twitch_loader(link):
124
  os.system(f"twitch-dl download -q audio_only {link} --output twitch.wav")
125
  return process('/home/user/app/twitch.wav')
126
 
127
- embed_html = '<iframe width="560" height="315" src="https://www.youtube.com/embed/EngW7tLk6R8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
128
-
129
 
130
  with demo:
131
  gr.Markdown("Select your input type.")
@@ -143,11 +141,11 @@ with demo:
143
  text_button4 = gr.Button("Flip")
144
  with gr.TabItem("From youtube"):
145
  with gr.Row():
146
- gr.HTML(embed_html)
147
- youtube_input = gr.Textbox(
148
- label="Insert your youtube link here.", placeholder='https://www.youtube.com/watch?v=dQw4w9WgXcQ')
149
- youtube_output = gr.Textbox()
150
- text_button2 = gr.Button("Flip")
151
  with gr.TabItem("From twitch"):
152
  with gr.Row():
153
  twitch_input = gr.Textbox(label="Insert your twitch link or ID here.",
 
19
  pipeline
20
  )
21
  processor = Wav2Vec2Processor.from_pretrained("airesearch/wav2vec2-large-xlsr-53-th")
22
+ model = Wav2Vec2ForCTC.from_pretrained("BALAKA/wav2vec2-large-xlsr-53-th-swear-words")
23
 
24
  demo = gr.Blocks()
25
 
 
124
  os.system(f"twitch-dl download -q audio_only {link} --output twitch.wav")
125
  return process('/home/user/app/twitch.wav')
126
 
 
 
127
 
128
  with demo:
129
  gr.Markdown("Select your input type.")
 
141
  text_button4 = gr.Button("Flip")
142
  with gr.TabItem("From youtube"):
143
  with gr.Row():
144
+ with gr.Column(scale=1, min_width=600):
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()
148
+ text_button2 = gr.Button("Flip")
149
  with gr.TabItem("From twitch"):
150
  with gr.Row():
151
  twitch_input = gr.Textbox(label="Insert your twitch link or ID here.",