Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,8 +38,7 @@ def transcribe(audio):
|
|
| 38 |
sr, y = audio
|
| 39 |
y = y.astype(np.float32)
|
| 40 |
y /= np.max(np.abs(y))
|
| 41 |
-
|
| 42 |
-
|
| 43 |
temp_filename = "temp_audio.wav"
|
| 44 |
write(temp_filename, sr, (y * 32767).astype(np.int16))
|
| 45 |
result = model.transcribe(temp_filename)
|
|
|
|
| 38 |
sr, y = audio
|
| 39 |
y = y.astype(np.float32)
|
| 40 |
y /= np.max(np.abs(y))
|
| 41 |
+
model = whisper.load_model("base") # or "small", "medium", "large", depending on your requirement
|
|
|
|
| 42 |
temp_filename = "temp_audio.wav"
|
| 43 |
write(temp_filename, sr, (y * 32767).astype(np.int16))
|
| 44 |
result = model.transcribe(temp_filename)
|