Siddhant commited on
Commit
8b0046a
1 Parent(s): ef3e243

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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-tiny.en")
52
  def int2float(sound):
53
  """
54
  Taken from https://github.com/snakers4/silero-vad
@@ -74,9 +74,9 @@ max_speech_ms=float("inf")
74
  LM_tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM-135M-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"
80
  )
81
 
82
  vad_model, _ = torch.hub.load("snakers4/silero-vad:v4.0", "silero_vad")
 
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-tiny.en", device="cuda")
52
  def int2float(sound):
53
  """
54
  Taken from https://github.com/snakers4/silero-vad
 
74
  LM_tokenizer = AutoTokenizer.from_pretrained("HuggingFaceTB/SmolLM-135M-Instruct")
75
  LM_model = AutoModelForCausalLM.from_pretrained(
76
  "HuggingFaceTB/SmolLM-360M-Instruct", torch_dtype="float16", trust_remote_code=True
77
+ ).to("cuda")
78
  LM_pipe = pipeline(
79
+ "text-generation", model=LM_model, tokenizer=LM_tokenizer, device="cuda"
80
  )
81
 
82
  vad_model, _ = torch.hub.load("snakers4/silero-vad:v4.0", "silero_vad")