Skip to content

Commit

Permalink
Merge pull request #170 from jhj0517/fix/shell-script
Browse files Browse the repository at this point in the history
Fix compatibility with Mac
  • Loading branch information
jhj0517 authored Jun 12, 2024
2 parents d1438f4 + 9234bb0 commit a78042e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion modules/faster_whisper_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ def __init__(self):
self.available_models = self.model_paths.keys()
self.available_langs = sorted(list(whisper.tokenizer.LANGUAGES.values()))
self.translatable_models = ["large", "large-v1", "large-v2", "large-v3"]
self.device = "cuda" if torch.cuda.is_available() else "cpu"
if torch.cuda.is_available():
self.device = "cuda"
elif torch.backends.mps.is_available():
self.device = "mps"
else:
self.device = "cpu"
self.available_compute_types = ctranslate2.get_supported_compute_types(
"cuda") if self.device == "cuda" else ctranslate2.get_supported_compute_types("cpu")
self.current_compute_type = "float16" if self.device == "cuda" else "float32"
Expand Down
6 changes: 6 additions & 0 deletions modules/whisper_Inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ def __init__(self):
self.available_models = whisper.available_models()
self.available_langs = sorted(list(whisper.tokenizer.LANGUAGES.values()))
self.translatable_model = ["large", "large-v1", "large-v2", "large-v3"]
if torch.cuda.is_available():
self.device = "cuda"
elif torch.backends.mps.is_available():
self.device = "mps"
else:
self.device = "cpu"
self.device = "cuda" if torch.cuda.is_available() else "cpu"
self.available_compute_types = ["float16", "float32"]
self.current_compute_type = "float16" if self.device == "cuda" else "float32"
Expand Down
2 changes: 0 additions & 2 deletions start-webui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ echo ""
$PYTHON ./app.py

echo "launching the app"

deactivate

0 comments on commit a78042e

Please sign in to comment.