tan-z-tan commited on
Commit
fc40471
·
1 Parent(s): 9996005
Files changed (1) hide show
  1. whisper.py +2 -3
whisper.py CHANGED
@@ -3,15 +3,14 @@ import torch
3
  from transformers import WhisperProcessor, WhisperForConditionalGeneration
4
 
5
  # Whisperモデルとプロセッサのロード
6
- model_name = "openai/whisper-tiny"
7
  processor = WhisperProcessor.from_pretrained(model_name)
8
  model = WhisperForConditionalGeneration.from_pretrained(model_name)
9
- # デバイスの設定(GPUが利用可能な場合はGPUを使用)
10
  device = "cuda" if torch.cuda.is_available() else "cpu"
11
  model.to(device)
12
 
13
  SAMPLING_RATE = 16000
14
- CHUNK_DURATION = 5 # 5秒ごとのチャンク
15
 
16
 
17
  def transcribe(chunk: np.ndarray) -> str:
 
3
  from transformers import WhisperProcessor, WhisperForConditionalGeneration
4
 
5
  # Whisperモデルとプロセッサのロード
6
+ model_name = "openai/whisper-base"
7
  processor = WhisperProcessor.from_pretrained(model_name)
8
  model = WhisperForConditionalGeneration.from_pretrained(model_name)
9
+
10
  device = "cuda" if torch.cuda.is_available() else "cpu"
11
  model.to(device)
12
 
13
  SAMPLING_RATE = 16000
 
14
 
15
 
16
  def transcribe(chunk: np.ndarray) -> str: