Skip to content

Commit

Permalink
Merge pull request #13 from ColoredCow/feature/make-sure-using-cuda
Browse files Browse the repository at this point in the history
disable whishper modes
  • Loading branch information
pankaj-ag authored Nov 12, 2024
2 parents e3ba829 + 5f651e8 commit b82a8af
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions transcription.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
def load_asr_model(modelName):
processor = WhisperProcessor.from_pretrained(modelName)
model = WhisperForConditionalGeneration.from_pretrained(modelName)
device = "cuda" if torch.cuda.is_available() else "cpu"
model = model.to(device)
return processor, model

def transcribe_audio(file_path, model, processor, language):
Expand Down

0 comments on commit b82a8af

Please sign in to comment.