Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -7,82 +7,82 @@ import evaluate
|
|
7 |
|
8 |
# Example prompts from the paper
|
9 |
EXAMPLES = [
|
10 |
-
# Each
|
11 |
-
|
12 |
"A man speaks with a booming, medium-pitched voice in a clear environment, delivering his words at a measured speed.",
|
13 |
"That's my brother. I do agree, though, it wasn't very well-groomed.",
|
14 |
1.5, 3, 20.0
|
15 |
-
|
16 |
-
|
17 |
"A male speaker's speech is distinguished by a slurred articulation, delivered at a measured pace in a clear environment.",
|
18 |
"reveal my true intentions in different ways. That's why the Street King Project and SMS",
|
19 |
1.5, 3, 20.0
|
20 |
-
|
21 |
-
|
22 |
"In a clear environment, a male speaker delivers his words hesitantly with a measured pace.",
|
23 |
"the Grand Slam tennis game has sort of taken over our set that's sort of all the way",
|
24 |
1.5, 3, 20.0
|
25 |
-
|
26 |
-
|
27 |
"A low-pitched, guttural male voice speaks slowly in a clear environment.",
|
28 |
"you know you want to see how far you can push everything and as an artist",
|
29 |
1.5, 3, 20.0
|
30 |
-
|
31 |
-
|
32 |
"A man speaks with a measured pace in a clear environment, displaying a distinct British accent.",
|
33 |
"most important but the reaction is very similar throughout the world it's really very very similar",
|
34 |
1.5, 3, 20.0
|
35 |
-
|
36 |
-
|
37 |
"A male speaker's voice is clear and delivered at a measured pace in a quiet environment. His speech carries a distinct Jamaican accent.",
|
38 |
"about God and the people him come from is more Christian, you know. We always",
|
39 |
1.5, 3, 20.0
|
40 |
-
|
41 |
-
|
42 |
"In a clear environment, a male voice speaks with a sad tone.",
|
43 |
"Was that your landlord?",
|
44 |
1.5, 3, 20.0
|
45 |
-
|
46 |
-
|
47 |
"A man speaks with a measured pace in a clear environment, his voice carrying a sleepy tone.",
|
48 |
"I mean, to be fair, I did see a UFO, so, you know.",
|
49 |
1.5, 3, 20.0
|
50 |
-
|
51 |
-
|
52 |
"A frightened woman speaks with a clear and distinct voice.",
|
53 |
"Yes, that's what they said. I don't know what you're getting done. What are you getting done? Oh, okay. Yeah.",
|
54 |
1.5, 3, 20.0
|
55 |
-
|
56 |
-
|
57 |
"A woman speaks slowly in a clear environment, her voice filled with awe.",
|
58 |
"Oh wow, this music is fantastic. You play so well. I could just sit here.",
|
59 |
1.5, 3, 20.0
|
60 |
-
|
61 |
-
|
62 |
"A woman speaks with a high-pitched voice in a clear environment, conveying a sense of anxiety.",
|
63 |
"this is just way too overwhelming. I literally don't know how I'm going to get any of this done on time. I feel so overwhelmed right now. No one is helping me. Everyone's ignoring my calls and my emails. I don't know what I'm supposed to do right now.",
|
64 |
1.5, 3, 20.0
|
65 |
-
|
66 |
-
|
67 |
"A female speaker's high-pitched voice is clear and carries over a laughing, unobstructed environment.",
|
68 |
"What is wrong with him, Chad?",
|
69 |
1.5, 3, 20.0
|
70 |
-
|
71 |
-
|
72 |
"In a clear environment, a man speaks in a whispered tone.",
|
73 |
"The fruit piece, the still lifes, you mean.",
|
74 |
1.5, 3, 20.0
|
75 |
-
|
76 |
-
|
77 |
"A male speaker with a husky, low-pitched voice delivers clear speech in a quiet environment.",
|
78 |
"Ari had to somehow be subservient to Lloyd that would be unbelievable like if Lloyd was the guy who was like running Time Warner you know what I mean like",
|
79 |
1.5, 3, 20.0
|
80 |
-
|
81 |
-
|
82 |
"A female speaker's voice is clear and expressed at a measured pace, but carries a high-pitched, nasal tone, recorded in a quiet environment.",
|
83 |
"You know, Joe Bow, hockey mom from Wasilla, if I have an idea that would perhaps make",
|
84 |
1.5, 3, 20.0
|
85 |
-
|
86 |
]
|
87 |
|
88 |
def wer(asr_pipeline, prompt, audio, sampling_rate):
|
@@ -317,4 +317,4 @@ def create_demo():
|
|
317 |
|
318 |
if __name__ == "__main__":
|
319 |
demo = create_demo()
|
320 |
-
demo.launch(share=True)
|
|
|
7 |
|
8 |
# Example prompts from the paper
|
9 |
EXAMPLES = [
|
10 |
+
# Each list is [description, text, guidance_scale, num_retries, wer_threshold]
|
11 |
+
[
|
12 |
"A man speaks with a booming, medium-pitched voice in a clear environment, delivering his words at a measured speed.",
|
13 |
"That's my brother. I do agree, though, it wasn't very well-groomed.",
|
14 |
1.5, 3, 20.0
|
15 |
+
],
|
16 |
+
[
|
17 |
"A male speaker's speech is distinguished by a slurred articulation, delivered at a measured pace in a clear environment.",
|
18 |
"reveal my true intentions in different ways. That's why the Street King Project and SMS",
|
19 |
1.5, 3, 20.0
|
20 |
+
],
|
21 |
+
[
|
22 |
"In a clear environment, a male speaker delivers his words hesitantly with a measured pace.",
|
23 |
"the Grand Slam tennis game has sort of taken over our set that's sort of all the way",
|
24 |
1.5, 3, 20.0
|
25 |
+
],
|
26 |
+
[
|
27 |
"A low-pitched, guttural male voice speaks slowly in a clear environment.",
|
28 |
"you know you want to see how far you can push everything and as an artist",
|
29 |
1.5, 3, 20.0
|
30 |
+
],
|
31 |
+
[
|
32 |
"A man speaks with a measured pace in a clear environment, displaying a distinct British accent.",
|
33 |
"most important but the reaction is very similar throughout the world it's really very very similar",
|
34 |
1.5, 3, 20.0
|
35 |
+
],
|
36 |
+
[
|
37 |
"A male speaker's voice is clear and delivered at a measured pace in a quiet environment. His speech carries a distinct Jamaican accent.",
|
38 |
"about God and the people him come from is more Christian, you know. We always",
|
39 |
1.5, 3, 20.0
|
40 |
+
],
|
41 |
+
[
|
42 |
"In a clear environment, a male voice speaks with a sad tone.",
|
43 |
"Was that your landlord?",
|
44 |
1.5, 3, 20.0
|
45 |
+
],
|
46 |
+
[
|
47 |
"A man speaks with a measured pace in a clear environment, his voice carrying a sleepy tone.",
|
48 |
"I mean, to be fair, I did see a UFO, so, you know.",
|
49 |
1.5, 3, 20.0
|
50 |
+
],
|
51 |
+
[
|
52 |
"A frightened woman speaks with a clear and distinct voice.",
|
53 |
"Yes, that's what they said. I don't know what you're getting done. What are you getting done? Oh, okay. Yeah.",
|
54 |
1.5, 3, 20.0
|
55 |
+
],
|
56 |
+
[
|
57 |
"A woman speaks slowly in a clear environment, her voice filled with awe.",
|
58 |
"Oh wow, this music is fantastic. You play so well. I could just sit here.",
|
59 |
1.5, 3, 20.0
|
60 |
+
],
|
61 |
+
[
|
62 |
"A woman speaks with a high-pitched voice in a clear environment, conveying a sense of anxiety.",
|
63 |
"this is just way too overwhelming. I literally don't know how I'm going to get any of this done on time. I feel so overwhelmed right now. No one is helping me. Everyone's ignoring my calls and my emails. I don't know what I'm supposed to do right now.",
|
64 |
1.5, 3, 20.0
|
65 |
+
],
|
66 |
+
[
|
67 |
"A female speaker's high-pitched voice is clear and carries over a laughing, unobstructed environment.",
|
68 |
"What is wrong with him, Chad?",
|
69 |
1.5, 3, 20.0
|
70 |
+
],
|
71 |
+
[
|
72 |
"In a clear environment, a man speaks in a whispered tone.",
|
73 |
"The fruit piece, the still lifes, you mean.",
|
74 |
1.5, 3, 20.0
|
75 |
+
],
|
76 |
+
[
|
77 |
"A male speaker with a husky, low-pitched voice delivers clear speech in a quiet environment.",
|
78 |
"Ari had to somehow be subservient to Lloyd that would be unbelievable like if Lloyd was the guy who was like running Time Warner you know what I mean like",
|
79 |
1.5, 3, 20.0
|
80 |
+
],
|
81 |
+
[
|
82 |
"A female speaker's voice is clear and expressed at a measured pace, but carries a high-pitched, nasal tone, recorded in a quiet environment.",
|
83 |
"You know, Joe Bow, hockey mom from Wasilla, if I have an idea that would perhaps make",
|
84 |
1.5, 3, 20.0
|
85 |
+
]
|
86 |
]
|
87 |
|
88 |
def wer(asr_pipeline, prompt, audio, sampling_rate):
|
|
|
317 |
|
318 |
if __name__ == "__main__":
|
319 |
demo = create_demo()
|
320 |
+
demo.launch(share=True)
|