Fix
Browse files- 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-
|
| 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 |
-
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:
|