Spaces:
Runtime error
Runtime error
daveokpare
commited on
Commit
·
b687745
1
Parent(s):
086bde1
Return text and state output
Browse files
app.py
CHANGED
@@ -7,13 +7,15 @@ model = WhisperModel(model_size, device="cpu", compute_type="int8")
|
|
7 |
|
8 |
|
9 |
def transcribe(audio, state=""):
|
|
|
10 |
segments, info = model.transcribe(audio, beam_size=5)
|
11 |
|
12 |
print("Detected language '%s' with probability %f" % (info.language, info.language_probability))
|
13 |
|
14 |
for segment in segments:
|
15 |
print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
|
16 |
-
|
|
|
17 |
|
18 |
return state, state
|
19 |
|
|
|
7 |
|
8 |
|
9 |
def transcribe(audio, state=""):
|
10 |
+
print(audio)
|
11 |
segments, info = model.transcribe(audio, beam_size=5)
|
12 |
|
13 |
print("Detected language '%s' with probability %f" % (info.language, info.language_probability))
|
14 |
|
15 |
for segment in segments:
|
16 |
print("[%.2fs -> %.2fs] %s" % (segment.start, segment.end, segment.text))
|
17 |
+
if segment.text.lower() != "you":
|
18 |
+
state += segment.text + " "
|
19 |
|
20 |
return state, state
|
21 |
|