Skip to content

Commit

Permalink
enable deepspeed on apple silicon
Browse files Browse the repository at this point in the history
  • Loading branch information
SSardorf committed Dec 18, 2024
1 parent bf79761 commit 3d419a1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
'scipy',
'librosa',
'transformers==4.31.0',
'tokenizers==0.14.0',
'scipy==1.13.1'
# 'deepspeed==0.8.3',
'tokenizers',
'scipy==1.13.1',
'deepspeed',
'py-cpuinfo'
],
classifiers=[
"Programming Language :: Python :: 3",
Expand Down
4 changes: 1 addition & 3 deletions tortoise/do_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
parser.add_argument('--voice', type=str, help='Selects the voice to use for generation. See options in voices/ directory (and add your own!) '
'Use the & character to join two voices together. Use a comma to perform inference on multiple voices.', default='random')
parser.add_argument('--preset', type=str, help='Which voice preset to use.', default='fast')
parser.add_argument('--use_deepspeed', type=str, help='Use deepspeed for speed bump.', default=False)
parser.add_argument('--use_deepspeed', type=bool, help='Use deepspeed for speed bump.', default=False)
parser.add_argument('--kv_cache', type=bool, help='If you disable this please wait for a long a time to get the output', default=True)
parser.add_argument('--half', type=bool, help="float16(half) precision inference if True it's faster and take less vram and ram", default=True)
parser.add_argument('--output_path', type=str, help='Where to store outputs.', default='results/')
Expand All @@ -25,8 +25,6 @@
parser.add_argument('--cvvp_amount', type=float, help='How much the CVVP model should influence the output.'
'Increasing this can in some cases reduce the likelihood of multiple speakers. Defaults to 0 (disabled)', default=.0)
args = parser.parse_args()
if torch.backends.mps.is_available():
args.use_deepspeed = False
os.makedirs(args.output_path, exist_ok=True)
tts = TextToSpeech(models_dir=args.model_dir, use_deepspeed=args.use_deepspeed, kv_cache=args.kv_cache, half=args.half)

Expand Down
2 changes: 0 additions & 2 deletions tortoise/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@


args = parser.parse_args()
if torch.backends.mps.is_available():
args.use_deepspeed = False
tts = TextToSpeech(models_dir=args.model_dir, use_deepspeed=args.use_deepspeed, kv_cache=args.kv_cache, half=args.half)

outpath = args.output_path
Expand Down
2 changes: 0 additions & 2 deletions tortoise/read_fast.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@


args = parser.parse_args()
if torch.backends.mps.is_available():
args.use_deepspeed = False
tts = TextToSpeech(models_dir=args.model_dir, use_deepspeed=args.use_deepspeed, kv_cache=args.kv_cache, half=args.half)

outpath = args.output_path
Expand Down
2 changes: 0 additions & 2 deletions tortoise/tts_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ def play_audio(audio_queue):


args = parser.parse_args()
if torch.backends.mps.is_available():
args.use_deepspeed = False
tts = TextToSpeech(models_dir=args.model_dir, use_deepspeed=args.use_deepspeed, kv_cache=args.kv_cache, half=args.half)

outpath = args.output_path
Expand Down

0 comments on commit 3d419a1

Please sign in to comment.