Skip to content

Commit

Permalink
Merge pull request #300 from netease-youdao/develop_for_v1.3.1
Browse files Browse the repository at this point in the history
refactor: Provide reasonable prompts when parsing audio.
  • Loading branch information
xixihahaliu authored Apr 26, 2024
2 parents 673c0d0 + 160e01a commit a66989f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions qanything_kernel/utils/loader/audio_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ def __init__(
self.use_cpu = use_cpu
if not whisper_model:
# TODO: CUDA memory may run out.
# if torch.cuda.is_available():
if False:
if torch.cuda.is_available():
debug_logger.warning("audio parser Using CUDA, may run out of memory.")
self.whisper_model = WhisperModel(self.model_name, device="cuda", compute_type="float16")
else:
debug_logger.warning("audio parser Using CPU, may take a long time.")
self.whisper_model = WhisperModel(self.model_name, device="cpu", compute_type="int8")
debug_logger.info(f"Using Whisper model: {self.model_name},file_path: {file_path}")
super().__init__(file_path=file_path, mode=mode, **unstructured_kwargs)
Expand Down

0 comments on commit a66989f

Please sign in to comment.