Spaces:
Runtime error
Runtime error
Update speech.py
Browse files
speech.py
CHANGED
@@ -173,7 +173,7 @@ def classify_continuous(audio):
|
|
173 |
|
174 |
|
175 |
|
176 |
-
def run_results():
|
177 |
global sum1,sum2,sum3
|
178 |
sum1=0
|
179 |
sum2=0
|
@@ -181,9 +181,9 @@ def run_results():
|
|
181 |
for i in range(29):
|
182 |
print("第",i+1,"段音频:")
|
183 |
if i<9:
|
184 |
-
filename="
|
185 |
else:
|
186 |
-
filename="
|
187 |
audio = wav.read(filename)
|
188 |
text,score=speech_score(audio)
|
189 |
# print(score)
|
@@ -224,8 +224,8 @@ with gr.Blocks() as demo:
|
|
224 |
)
|
225 |
run_button.click(
|
226 |
fn=run_results,
|
227 |
-
inputs=[],
|
228 |
-
outputs=[
|
229 |
)
|
230 |
|
231 |
|
|
|
173 |
|
174 |
|
175 |
|
176 |
+
def run_results(file):
|
177 |
global sum1,sum2,sum3
|
178 |
sum1=0
|
179 |
sum2=0
|
|
|
181 |
for i in range(29):
|
182 |
print("第",i+1,"段音频:")
|
183 |
if i<9:
|
184 |
+
filename=file+"/0"+str(i+1)+".wav"
|
185 |
else:
|
186 |
+
filename=file+"/"+str(i+1)+".wav"
|
187 |
audio = wav.read(filename)
|
188 |
text,score=speech_score(audio)
|
189 |
# print(score)
|
|
|
224 |
)
|
225 |
run_button.click(
|
226 |
fn=run_results,
|
227 |
+
inputs=[output_log1],
|
228 |
+
outputs=[output_log2]
|
229 |
)
|
230 |
|
231 |
|