Skip to content

Commit

Permalink
fix pre-commit removing unwanted model
Browse files Browse the repository at this point in the history
  • Loading branch information
kurianbenoy committed Mar 4, 2024
1 parent 50782dc commit 8638e8e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def download_models():
compute_type="float16",
)

model = whisper.load_model("base")
whisper.load_model("base")


def base64_to_audio_file(b64_contents: str):
Expand Down Expand Up @@ -88,6 +88,7 @@ def convert_to_mono_16k(input_file: str, output_file: str) -> None:
sound = sound.set_channels(1).set_frame_rate(16000)
sound.export(output_file, format="wav")


def whisper_language_detection(fname):
import whisper

Expand All @@ -105,6 +106,7 @@ def whisper_language_detection(fname):
print(f"Detected language: {max(probs, key=probs.get)}")
return {"detected_language": max(probs, key=probs.get)}


# def faster_whisper_language_detection(af):
# from faster_whisper import WhisperModel
# from faster_whisper.audio import decode_audio, pad_or_trim
Expand Down

0 comments on commit 8638e8e

Please sign in to comment.