Liusuthu commited on
Commit
10d71a1
Β·
verified Β·
1 Parent(s): 303adc8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -54,7 +54,7 @@ def classify_continuous(audio):
54
  text_results += punc.punctuate(_result)[0]
55
 
56
  out_prob, score, index, text_lab = classifier.classify_batch(signal1)
57
- return text_results, out_prob.squeeze(0).numpy(), text_lab[-1]
58
 
59
 
60
  #########################################θ§†ι’‘ιƒ¨εˆ†###################################
@@ -93,10 +93,10 @@ with gr.Blocks(css="app.css") as video:
93
  )
94
  output_audio=gr.Audio(interactive=False)
95
  audio_test_button=gr.Button("εˆ†ζžθ―­ιŸ³")
96
- button2=gr.Button("η›΄ζŽ₯θ°ƒε–θ·―εΎ„εˆ†ζž")
97
  out1=gr.Textbox(label="θ―­ιŸ³εˆ†ζžη»“ζžœ")
98
  out2=gr.Textbox(label="ιŸ³ι’‘ζƒ…ζ„Ÿθ―†εˆ«1")
99
  out3=gr.Textbox(label="ιŸ³ι’‘ζƒ…ζ„Ÿθ―†εˆ«2")
 
100
  gr.Examples(
101
  [
102
  "videos/video1.mp4",
@@ -132,12 +132,7 @@ with gr.Blocks(css="app.css") as video:
132
  audio_test_button.click(
133
  fn=classify_continuous,
134
  inputs=output_audio,
135
- outputs=[out1,out2,out3]
136
- )
137
- button2.click(
138
- fn=classify_continuous,
139
- inputs=["audio.wav"],
140
- outputs=[out1,out2,out3]
141
  )
142
 
143
  ####################################
 
54
  text_results += punc.punctuate(_result)[0]
55
 
56
  out_prob, score, index, text_lab = classifier.classify_batch(signal1)
57
+ return text_results, out_prob.squeeze(0).numpy(), text_lab[-1], Audio
58
 
59
 
60
  #########################################θ§†ι’‘ιƒ¨εˆ†###################################
 
93
  )
94
  output_audio=gr.Audio(interactive=False)
95
  audio_test_button=gr.Button("εˆ†ζžθ―­ιŸ³")
 
96
  out1=gr.Textbox(label="θ―­ιŸ³εˆ†ζžη»“ζžœ")
97
  out2=gr.Textbox(label="ιŸ³ι’‘ζƒ…ζ„Ÿθ―†εˆ«1")
98
  out3=gr.Textbox(label="ιŸ³ι’‘ζƒ…ζ„Ÿθ―†εˆ«2")
99
+ internal_audio=gr.Audio(interactive=False)
100
  gr.Examples(
101
  [
102
  "videos/video1.mp4",
 
132
  audio_test_button.click(
133
  fn=classify_continuous,
134
  inputs=output_audio,
135
+ outputs=[out1,out2,out3,internal_audio]
 
 
 
 
 
136
  )
137
 
138
  ####################################