Spaces:
Sleeping
Sleeping
update app
Browse files
app.py
CHANGED
@@ -10,10 +10,9 @@ import warnings
|
|
10 |
warnings.filterwarnings("ignore")
|
11 |
|
12 |
secret_token = "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"
|
|
|
|
|
13 |
|
14 |
-
model = whisper.load_model("base")
|
15 |
-
|
16 |
-
model.device
|
17 |
|
18 |
"""Transcribe function"""
|
19 |
|
@@ -31,10 +30,10 @@ def transcribe(audio):
|
|
31 |
_, probs = model.detect_language(mel)
|
32 |
|
33 |
# decode the audio
|
34 |
-
options = whisper.DecodingOptions()
|
35 |
result = whisper.decode(model, mel, options)
|
36 |
|
37 |
-
print(
|
38 |
result_text = result.text
|
39 |
|
40 |
# Pass the generated text to audio
|
|
|
10 |
warnings.filterwarnings("ignore")
|
11 |
|
12 |
secret_token = "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"
|
13 |
+
|
14 |
+
model = whisper.load_model("small")
|
15 |
|
|
|
|
|
|
|
16 |
|
17 |
"""Transcribe function"""
|
18 |
|
|
|
30 |
_, probs = model.detect_language(mel)
|
31 |
|
32 |
# decode the audio
|
33 |
+
options = whisper.DecodingOptions(fp16=False)
|
34 |
result = whisper.decode(model, mel, options)
|
35 |
|
36 |
+
print(result.text)
|
37 |
result_text = result.text
|
38 |
|
39 |
# Pass the generated text to audio
|