Spaces:
Runtime error
Runtime error
save
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import os
|
2 |
os.system("pip install git+https://github.com/sanchit-gandhi/whisper-jax.git")
|
3 |
|
4 |
-
import whisper
|
5 |
from flask import Flask, jsonify, request
|
6 |
import requests
|
7 |
import time
|
@@ -44,7 +44,7 @@ def runApi():
|
|
44 |
|
45 |
audio = "audio.mp3"
|
46 |
|
47 |
-
audioOri = whisper.load_audio(audio)
|
48 |
# audio = whisper.pad_or_trim(audioOri)
|
49 |
|
50 |
# mel = whisper.log_mel_spectrogram(audio).to(model.device)
|
@@ -57,7 +57,7 @@ def runApi():
|
|
57 |
# test 2
|
58 |
# ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
|
59 |
# sample = ds[0]["audio"]
|
60 |
-
prediction = pipe(
|
61 |
|
62 |
|
63 |
end_time = time.time()
|
|
|
1 |
import os
|
2 |
os.system("pip install git+https://github.com/sanchit-gandhi/whisper-jax.git")
|
3 |
|
4 |
+
# import whisper
|
5 |
from flask import Flask, jsonify, request
|
6 |
import requests
|
7 |
import time
|
|
|
44 |
|
45 |
audio = "audio.mp3"
|
46 |
|
47 |
+
# audioOri = whisper.load_audio(audio)
|
48 |
# audio = whisper.pad_or_trim(audioOri)
|
49 |
|
50 |
# mel = whisper.log_mel_spectrogram(audio).to(model.device)
|
|
|
57 |
# test 2
|
58 |
# ds = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")
|
59 |
# sample = ds[0]["audio"]
|
60 |
+
prediction = pipe(audio)["text"]
|
61 |
|
62 |
|
63 |
end_time = time.time()
|