Emmanuel08 commited on
Commit
3871faf
·
verified ·
1 Parent(s): 826b8e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -19,6 +19,7 @@ model.to(device)
19
 
20
  # ✅ 3️⃣ Load Processor & Pipeline
21
  processor = AutoProcessor.from_pretrained(MODEL_NAME)
 
22
 
23
  pipe = pipeline(
24
  task="automatic-speech-recognition",
@@ -28,7 +29,6 @@ pipe = pipeline(
28
  chunk_length_s=2, # ✅ Process in 2-second chunks for ultra-low latency
29
  torch_dtype=torch_dtype,
30
  device=device,
31
- sampling_rate=16000, # ✅ Explicitly set sampling rate
32
  )
33
 
34
  # ✅ 4️⃣ Real-Time Streaming Transcription (Microphone)
 
19
 
20
  # ✅ 3️⃣ Load Processor & Pipeline
21
  processor = AutoProcessor.from_pretrained(MODEL_NAME)
22
+ processor.feature_extractor.sampling_rate = 16000 # ✅ Set correct sampling rate here
23
 
24
  pipe = pipeline(
25
  task="automatic-speech-recognition",
 
29
  chunk_length_s=2, # ✅ Process in 2-second chunks for ultra-low latency
30
  torch_dtype=torch_dtype,
31
  device=device,
 
32
  )
33
 
34
  # ✅ 4️⃣ Real-Time Streaming Transcription (Microphone)