Siddhant commited on
Commit
16c6824
1 Parent(s): a5ee5dc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -48,7 +48,7 @@ user_role = "user"
48
  tts_model = TTS(language="EN_NEWEST", device="auto")
49
  speaker_id = tts_model.hps.data.spk2id["EN-Newest"]
50
  blocksize = 512
51
- transcriber = pipeline("automatic-speech-recognition", model="openai/whisper-base.en")
52
  def int2float(sound):
53
  """
54
  Taken from https://github.com/snakers4/silero-vad
@@ -66,14 +66,14 @@ audio_output = None
66
  min_speech_ms=500
67
  max_speech_ms=float("inf")
68
  # ASR_model = LightningWhisperMLX(model="distil-large-v3", batch_size=6, quant=None)
69
- ASR_processor = AutoProcessor.from_pretrained("distil-whisper/distil-large-v3")
70
- ASR_model = AutoModelForSpeechSeq2Seq.from_pretrained(
71
- "distil-whisper/distil-large-v3",
72
- torch_dtype="float16",
73
- ).to("cpu")
74
- LM_tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM-360M-Instruct")
75
  LM_model = AutoModelForCausalLM.from_pretrained(
76
- "HuggingFaceTB/SmolLM-360M-Instruct", torch_dtype="float16", trust_remote_code=True
77
  ).to("cpu")
78
  LM_pipe = pipeline(
79
  "text-generation", model=LM_model, tokenizer=LM_tokenizer, device="cpu"
 
48
  tts_model = TTS(language="EN_NEWEST", device="auto")
49
  speaker_id = tts_model.hps.data.spk2id["EN-Newest"]
50
  blocksize = 512
51
+ transcriber = pipeline("automatic-speech-recognition", model="distil-whisper/distil-large-v3")
52
  def int2float(sound):
53
  """
54
  Taken from https://github.com/snakers4/silero-vad
 
66
  min_speech_ms=500
67
  max_speech_ms=float("inf")
68
  # ASR_model = LightningWhisperMLX(model="distil-large-v3", batch_size=6, quant=None)
69
+ # ASR_processor = AutoProcessor.from_pretrained("distil-whisper/distil-large-v3")
70
+ # ASR_model = AutoModelForSpeechSeq2Seq.from_pretrained(
71
+ # "distil-whisper/distil-large-v3",
72
+ # torch_dtype="float16",
73
+ # ).to("cpu")
74
+ LM_tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM-135M-Instruct")
75
  LM_model = AutoModelForCausalLM.from_pretrained(
76
+ "HuggingFaceTB/SmolLM-135M-Instruct", torch_dtype="float16", trust_remote_code=True
77
  ).to("cpu")
78
  LM_pipe = pipeline(
79
  "text-generation", model=LM_model, tokenizer=LM_tokenizer, device="cpu"